You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by liumin HU <lh...@sigems.fr> on 2007/12/31 12:11:35 UTC

how it works jxpathcontext removeall?

hi everyone,

I use jxpath to manage an ArrayList of bean, the Context is created like: JXPathContext context=JXPathContext.newContext(list);

When I want to delete some objects in the arraylist, i used  context.removeall, but it doesn't work. 
Before and after call of removeall, the value of count is always 1.

context.getVariables().declareVariable("heure", _h);
System.out.println(context.getValue("count(/.[heureSelected=$heure])"));  ====> 1.0
context.removePath("/.[heureSelected=$heure]");
System.out.println(context.getValue("count(/.[heureSelected=$heure])")); ====> 1.0

I tried too iterator.remove(), i got a exception.
 
Iterator<HeurePrescription> iter = context.iterate("/.[heureSelected=$heure]");
 while(iter.hasNext()){
     iter.next();
     iter.remove();
 }

Any help is appreciated.

Thanks in advance

Liu

Re: [math] Minimizer

Posted by mi...@TaosNet.com.
>>You can open a JIRA ticket to make sure we do not forget
>> this need.
Done:
                 Key: MATH-177
                 URL: https://issues.apache.org/jira/browse/MATH-177
             Project: Commons Math
          Issue Type: Improvement
    Affects Versions: 2.0
            Reporter: Mick
             Fix For: 2.0


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] jar after 08/19/2007

Posted by Phil Steitz <ph...@gmail.com>.
Luc is right that to work with unreleased sources, it is best to
checkout and build from svn.  Feel free to ask questions here or
offline if you need help getting set up with subversion or maven.

I did just deploy a new snapshot jar to the apache snapshot repository here
http://people.apache.org/repo/m2-snapshot-repository/commons-math/commons-math/1.2-SNAPSHOT/
the new snapshot jar is commons-math-1.2-20080119.205359-2.jar

Note that the snapshot builds in this repository are not ASF releases
and should be used with caution.

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] jar after 08/19/2007

Posted by Luc Maisonobe <Lu...@free.fr>.
mickeydog@TaosNet.com wrote:
> Is a jar available for commons math after 08/19/2007?

There is a result from a build in November here:
http://people.apache.org/builds/jakarta-commons/nightly/commons-math/commons-math-20071120-tar.gz

These compressed archive contains lots of things, including a 
commons-math-1.2-SNAPSHOT.jar file.

You can also build one yourself from the subversion tree, which has 
anonymous access enabled. You need a subversion client and maven 2. Here 
is an exemple using the "svn" command line program in a GNU/Linux box:

svn co http://svn.apache.org/repos/asf/commons/proper/math/trunk math
cd math
mvn package

You should end up with a commons-math-1.2-SNAPSHOT.jar file in the 
target directory.

Luc


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Luc Maisonobe <Lu...@free.fr>.
Al Lelopath a écrit :
> Ok, I have the source now. Thank you.
> 
> Having some compile troubles. I've included the beanutils and
> discovery jars in the project.
> There are several source folders:
> src/experimental
> src/java
> src/mantissa/src
> src/mantissa/test-src
> src/
> 
> src/java is the only one the compiles correctly at the moment.
> Listed below are representative errors. Can you offer any suggestions?

src/java is the [math] library by itself. The mantissa directories 
correspond to a code base that is progressively integrated into [math]. 
Some parts have already been merged (Levenberg-Marquardt comes from 
here) and hence they have been removed from this directory. Some 
remaining parts did depend on the the transfered part so they cannot be 
compiled anymore since the package names have been changed from 
org.spaceroots to org.apache.commons.

The simplest way to compile everything is to use maven 
(http://maven.apache.org/). Thanks to both its default settings and the 
pom.xml configuration file, maven knows which directories should be 
ignored. Download maven and launch it from the top directory like this:

   mvn package

This will download "lots" of maven own plugins and the few dependencies 
[math] needs. Hopefully, this huge download occurs only the first time 
one uses maven. At the end, you should have a jar file in the target 
directory.

Maven can be launched from a command shell as explained above, but can 
also be integrated in your development environment (Eclipse, for example).

There are other ways to build [math] (using ant, using maven 1, using 
eclipse ...).

Luc

> 
> The import org.spaceroots.mantissa.estimation cannot be resolved
> AbstractCurveFitter.java
> commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
> line 24
> 
> coefficients cannot be resolved    AbstractCurveFitter.java
> commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
> line 112
> 
> CorrelatedRandomVectorGeneratorTest cannot be resolved
> AllTests.java
> commons-math-trunk/src/mantissa/tests-src/org/spaceroots/mantissa/random
>    line 33
> 
> DescriptiveStatistics cannot be resolved to a type
> BeanListUnivariateImplTest.java
> commons-math-trunk/src/experimental/org/apache/commons/math/stat/univariate
>    line 153
> 
> EstimatedParameter cannot be resolved to a type
> AbstractCurveFitter.java
> commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
> line 119
> 
> GaussNewtonEstimator cannot be resolved to a type
> HarmonicFitter.java
> commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
> line 131
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Al Lelopath <jd...@gmail.com>.
Ok, I have the source now. Thank you.

Having some compile troubles. I've included the beanutils and
discovery jars in the project.
There are several source folders:
src/experimental
src/java
src/mantissa/src
src/mantissa/test-src
src/

src/java is the only one the compiles correctly at the moment.
Listed below are representative errors. Can you offer any suggestions?

The import org.spaceroots.mantissa.estimation cannot be resolved
AbstractCurveFitter.java
commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
line 24

coefficients cannot be resolved    AbstractCurveFitter.java
commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
line 112

CorrelatedRandomVectorGeneratorTest cannot be resolved
AllTests.java
commons-math-trunk/src/mantissa/tests-src/org/spaceroots/mantissa/random
   line 33

DescriptiveStatistics cannot be resolved to a type
BeanListUnivariateImplTest.java
commons-math-trunk/src/experimental/org/apache/commons/math/stat/univariate
   line 153

EstimatedParameter cannot be resolved to a type
AbstractCurveFitter.java
commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
line 119

GaussNewtonEstimator cannot be resolved to a type
HarmonicFitter.java
commons-math-trunk/src/mantissa/src/org/spaceroots/mantissa/fitting
line 131

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Al Lelopath <jd...@gmail.com>.
Checking thresholds:
Started at the default of course (1000) and have gone to 10^4, 10^5,
10^6 with the same result
(with my 'manually' modified code, not from repository

On Jan 29, 2008 9:41 AM, Al Lelopath <jd...@gmail.com> wrote:
> I am having trouble accessing the svn repository, so for now, I'll
> have to change the code myself.
> If you are going to make the change below, then I guess a new
> constructor must be added to EstimationException:
>
>     public EstimationException(String specifier, Object[] parts) {
>         super(specifier, parts);
>
>     }
>
> On Jan 28, 2008 11:23 AM, Luc Maisonobe <Lu...@free.fr> wrote:
> > Mickey wrote:
> > > When using the LevenbergMarquardtEstimator to solve for a quardratic
> > > equation. I get the exception below. Can anyone explain to me what is
> > > happening? This code works for most data that I have, but not in this
> > > particular case. This code is set into motion by clicking a button.
> > >
> > > The code that throw the exception is:
> > >
> > > throw new EstimationException("maximal number of evaluations exceeded
> > > ({0})",
> > >                             new String[] {
> > >                             Integer.toString(maxCostEval)
> > >                        });
> > >
> > > In this case maxCostEval is 1000. I tried setting it to 10,000, but I
> > > still get the same error. I'm confused first of all in that the String
> > > above doesn't appear in the exception and second in what the
> > > NoSuchMethodError is supposed to indicate.
> > >
> > > exception:
> > > ------------------------------------------------------------------------------
> > >
> > > Jan 28, 2008 7:45:52 AM STDERR: Exception in thread "AWT-EventQueue-0"
> > > Jan 28, 2008 7:45:52 AM STDERR: java.lang.NoSuchMethodError:
> > > org.apache.commons.math.MathException.<init>(Ljava/lang/String;[Ljava/lang/Object;)V
> > >
> > > Jan 28, 2008 7:45:52 AM STDERR:     at
> > > org.apache.commons.math.estimation.EstimationException.<init>(EstimationException.java:42)
> > >
> > > Jan 28, 2008 7:45:52 AM STDERR:     at
> > > org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate(LevenbergMarquardtEstimator.java:511)
> >
> > This shows an error in [math], thanks for reporting it. I have fixed
> > this as of r615975 a few minutes ago. You seem to have a version more
> > than a few days old (this code has changed recently), so either you
> > check out the all source again or you port the fix into your version.
> > For this, you should change in the exception construction:
> >           new String[] {
> >             Integer.toString(maxCostEval)
> >           });
> > into:
> >           new Object[] { new Integer(maxCostEval) });
> >
> >
> >
> > However, the fact the exception is thrown shows there is a convergence
> > problem. Could you check the thresholds ?
> >
> >
> > Luc
> >
> >
> > > (... and more ...)
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Luc Maisonobe <Lu...@free.fr>.
Al Lelopath wrote:
> I am having trouble accessing the svn repository, so for now, I'll
> have to change the code myself.
> If you are going to make the change below, then I guess a new
> constructor must be added to EstimationException:
> 
>     public EstimationException(String specifier, Object[] parts) {
>         super(specifier, parts);
>     }

Yes. In fact it is the only constructor remaining in this class right now.

Luc

> 
> On Jan 28, 2008 11:23 AM, Luc Maisonobe <Lu...@free.fr> wrote:
>> Mickey wrote:
>>> When using the LevenbergMarquardtEstimator to solve for a quardratic
>>> equation. I get the exception below. Can anyone explain to me what is
>>> happening? This code works for most data that I have, but not in this
>>> particular case. This code is set into motion by clicking a button.
>>>
>>> The code that throw the exception is:
>>>
>>> throw new EstimationException("maximal number of evaluations exceeded
>>> ({0})",
>>>                             new String[] {
>>>                             Integer.toString(maxCostEval)
>>>                        });
>>>
>>> In this case maxCostEval is 1000. I tried setting it to 10,000, but I
>>> still get the same error. I'm confused first of all in that the String
>>> above doesn't appear in the exception and second in what the
>>> NoSuchMethodError is supposed to indicate.
>>>
>>> exception:
>>> ------------------------------------------------------------------------------
>>>
>>> Jan 28, 2008 7:45:52 AM STDERR: Exception in thread "AWT-EventQueue-0"
>>> Jan 28, 2008 7:45:52 AM STDERR: java.lang.NoSuchMethodError:
>>> org.apache.commons.math.MathException.<init>(Ljava/lang/String;[Ljava/lang/Object;)V
>>>
>>> Jan 28, 2008 7:45:52 AM STDERR:     at
>>> org.apache.commons.math.estimation.EstimationException.<init>(EstimationException.java:42)
>>>
>>> Jan 28, 2008 7:45:52 AM STDERR:     at
>>> org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate(LevenbergMarquardtEstimator.java:511)
>> This shows an error in [math], thanks for reporting it. I have fixed
>> this as of r615975 a few minutes ago. You seem to have a version more
>> than a few days old (this code has changed recently), so either you
>> check out the all source again or you port the fix into your version.
>> For this, you should change in the exception construction:
>>           new String[] {
>>             Integer.toString(maxCostEval)
>>           });
>> into:
>>           new Object[] { new Integer(maxCostEval) });
>>
>>
>>
>> However, the fact the exception is thrown shows there is a convergence
>> problem. Could you check the thresholds ?
>>
>>
>> Luc
>>
>>
>>> (... and more ...)
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Al Lelopath <jd...@gmail.com>.
I am having trouble accessing the svn repository, so for now, I'll
have to change the code myself.
If you are going to make the change below, then I guess a new
constructor must be added to EstimationException:

    public EstimationException(String specifier, Object[] parts) {
        super(specifier, parts);
    }

On Jan 28, 2008 11:23 AM, Luc Maisonobe <Lu...@free.fr> wrote:
> Mickey wrote:
> > When using the LevenbergMarquardtEstimator to solve for a quardratic
> > equation. I get the exception below. Can anyone explain to me what is
> > happening? This code works for most data that I have, but not in this
> > particular case. This code is set into motion by clicking a button.
> >
> > The code that throw the exception is:
> >
> > throw new EstimationException("maximal number of evaluations exceeded
> > ({0})",
> >                             new String[] {
> >                             Integer.toString(maxCostEval)
> >                        });
> >
> > In this case maxCostEval is 1000. I tried setting it to 10,000, but I
> > still get the same error. I'm confused first of all in that the String
> > above doesn't appear in the exception and second in what the
> > NoSuchMethodError is supposed to indicate.
> >
> > exception:
> > ------------------------------------------------------------------------------
> >
> > Jan 28, 2008 7:45:52 AM STDERR: Exception in thread "AWT-EventQueue-0"
> > Jan 28, 2008 7:45:52 AM STDERR: java.lang.NoSuchMethodError:
> > org.apache.commons.math.MathException.<init>(Ljava/lang/String;[Ljava/lang/Object;)V
> >
> > Jan 28, 2008 7:45:52 AM STDERR:     at
> > org.apache.commons.math.estimation.EstimationException.<init>(EstimationException.java:42)
> >
> > Jan 28, 2008 7:45:52 AM STDERR:     at
> > org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate(LevenbergMarquardtEstimator.java:511)
>
> This shows an error in [math], thanks for reporting it. I have fixed
> this as of r615975 a few minutes ago. You seem to have a version more
> than a few days old (this code has changed recently), so either you
> check out the all source again or you port the fix into your version.
> For this, you should change in the exception construction:
>           new String[] {
>             Integer.toString(maxCostEval)
>           });
> into:
>           new Object[] { new Integer(maxCostEval) });
>
>
>
> However, the fact the exception is thrown shows there is a convergence
> problem. Could you check the thresholds ?
>
>
> Luc
>
>
> > (... and more ...)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Luc Maisonobe <Lu...@free.fr>.
Mickey wrote:
> When using the LevenbergMarquardtEstimator to solve for a quardratic 
> equation. I get the exception below. Can anyone explain to me what is 
> happening? This code works for most data that I have, but not in this 
> particular case. This code is set into motion by clicking a button.
> 
> The code that throw the exception is:
> 
> throw new EstimationException("maximal number of evaluations exceeded 
> ({0})",
>                             new String[] {
>                             Integer.toString(maxCostEval)
>                        });
> 
> In this case maxCostEval is 1000. I tried setting it to 10,000, but I 
> still get the same error. I'm confused first of all in that the String 
> above doesn't appear in the exception and second in what the 
> NoSuchMethodError is supposed to indicate.
> 
> exception: 
> ------------------------------------------------------------------------------ 
> 
> Jan 28, 2008 7:45:52 AM STDERR: Exception in thread "AWT-EventQueue-0"
> Jan 28, 2008 7:45:52 AM STDERR: java.lang.NoSuchMethodError: 
> org.apache.commons.math.MathException.<init>(Ljava/lang/String;[Ljava/lang/Object;)V 
> 
> Jan 28, 2008 7:45:52 AM STDERR:     at 
> org.apache.commons.math.estimation.EstimationException.<init>(EstimationException.java:42) 
> 
> Jan 28, 2008 7:45:52 AM STDERR:     at 
> org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate(LevenbergMarquardtEstimator.java:511) 

This shows an error in [math], thanks for reporting it. I have fixed 
this as of r615975 a few minutes ago. You seem to have a version more 
than a few days old (this code has changed recently), so either you 
check out the all source again or you port the fix into your version. 
For this, you should change in the exception construction:
          new String[] {
            Integer.toString(maxCostEval)
          });
into:
          new Object[] { new Integer(maxCostEval) });



However, the fact the exception is thrown shows there is a convergence 
problem. Could you check the thresholds ?


Luc

> (... and more ...)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[math] LevenbergMarquardtEstimator - maximal number of evaluations exceeded

Posted by Mickey <mi...@taosnet.com>.
When using the LevenbergMarquardtEstimator to solve for a quardratic 
equation. I get the exception below. Can anyone explain to me what is 
happening? This code works for most data that I have, but not in this 
particular case. This code is set into motion by clicking a button.

The code that throw the exception is:

throw new EstimationException("maximal number of evaluations exceeded 
({0})",
                             new String[] {
                             Integer.toString(maxCostEval)
                        });

In this case maxCostEval is 1000. I tried setting it to 10,000, but I 
still get the same error. I'm confused first of all in that the String 
above doesn't appear in the exception and second in what the 
NoSuchMethodError is supposed to indicate.

exception: 
------------------------------------------------------------------------------
Jan 28, 2008 7:45:52 AM 
STDERR: Exception in thread "AWT-EventQueue-0"
Jan 28, 2008 7:45:52 AM 
STDERR: java.lang.NoSuchMethodError: 
org.apache.commons.math.MathException.<init>(Ljava/lang/String;[Ljava/lang/Object;)V
Jan 28, 2008 7:45:52 AM 
STDERR:     at 
org.apache.commons.math.estimation.EstimationException.<init>(EstimationException.java:42)
Jan 28, 2008 7:45:52 AM 
STDERR:     at 
org.apache.commons.math.estimation.LevenbergMarquardtEstimator.estimate(LevenbergMarquardtEstimator.java:511)
(... and more ...)

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[math] jar after 08/19/2007

Posted by mi...@TaosNet.com.
Is a jar available for commons math after 08/19/2007?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by Luc Maisonobe <Lu...@free.fr>.
mickeydog@TaosNet.com a écrit :
> I'm not sure why you recommended minimizing z^2, as opposed to just z.
> If, for example, z12 = f(1,2) = -5 and z41 = f(4,1) = 2, then z12^2 = 25
> and z41^2 = 4, thus giving z41 as the minimum point, not z12.

You are right, but currently we provide least squares only. If you know 
a low bounding value (say -100 or -1.Oe6), you can use (z + low)^2. The 
limitation to least-squares problems comes from the Levenberg-Marquardt 
algorithm. For a more general minimizer (not for quadratic forms), you 
may try to modify the Gauss-Newton algorithm implementation. The 
classical algorithm is not specialized, but my current implementation in 
[math] is. I dealt with least squares problems only when I wrote this.

We should certainly refactor this and provide a general minimizing 
package with a classical GN, steepest descent and also conjugate 
gradient. We could use them as a basis for some least-squares solvers 
(and also keep the very efficient and specialized Levenberg-Marquardt 
too). Such a new package would be nice for 2.0. For now we are trying to 
finalize 1.2. You can open a JIRA ticket to make sure we do not forget 
this need.

Luc


> 
>>>> I have a curve of surface that is guaranteed to have one minimum.
>>>> How would I use apache commons to find it?
>> The current subversion tree provides an
>> org.apache.commons.math.optimization package which contains a
>> Levenberg-Marquardt least squares solver. For a 2D surface in a 3D
>> space, you could say your problem is to find the pair (x,y) that
>> minimizes z^2 with z=f(x,y). For a 1D problem, you may prefer to solve
>> f'(x) = 0 using one of the existing root solvers.
>>
>> The optimization code has not been released for now (it will be part of
>> the 1.2 release), but it is quite stable. You will find examples in the
>> archive of this list.
>>
>> Luc
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by mi...@TaosNet.com.
I'm not sure why you recommended minimizing z^2, as opposed to just z.
If, for example, z12 = f(1,2) = -5 and z41 = f(4,1) = 2, then z12^2 = 25
and z41^2 = 4, thus giving z41 as the minimum point, not z12.

>>> I have a curve of surface that is guaranteed to have one minimum.
>>> How would I use apache commons to find it?
>
> The current subversion tree provides an
> org.apache.commons.math.optimization package which contains a
> Levenberg-Marquardt least squares solver. For a 2D surface in a 3D
> space, you could say your problem is to find the pair (x,y) that
> minimizes z^2 with z=f(x,y). For a 1D problem, you may prefer to solve
> f'(x) = 0 using one of the existing root solvers.
>
> The optimization code has not been released for now (it will be part of
> the 1.2 release), but it is quite stable. You will find examples in the
> archive of this list.
>
> Luc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by Luc Maisonobe <Lu...@free.fr>.
mickeydog@TaosNet.com a écrit :
> sorry .. curve OR surface
> 
>> Does the math API have a minimizer?
>>
>> I have a curve of surface that is guaranteed to have one minimum.
>> How would I use apache commons to find it?

The current subversion tree provides an 
org.apache.commons.math.optimization package which contains a 
Levenberg-Marquardt least squares solver. For a 2D surface in a 3D 
space, you could say your problem is to find the pair (x,y) that 
minimizes z^2 with z=f(x,y). For a 1D problem, you may prefer to solve 
f'(x) = 0 using one of the existing root solvers.

The optimization code has not been released for now (it will be part of 
the 1.2 release), but it is quite stable. You will find examples in the 
archive of this list.

Luc


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by Luc Maisonobe <Lu...@free.fr>.
mickeydog@TaosNet.com a écrit :
>>> The current subversion tree provides an
> org.apache.commons.math.optimization >>package which contains a
> Levenberg-Marquardt least squares solver.
> Do you mean to say the org.apache.commons.math.estimation package?

Yes, sorry for the confusion

Luc



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by mi...@TaosNet.com.
>>The current subversion tree provides an
org.apache.commons.math.optimization >>package which contains a
Levenberg-Marquardt least squares solver.
Do you mean to say the org.apache.commons.math.estimation package?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [math] Minimizer

Posted by mi...@TaosNet.com.
sorry .. curve OR surface

> Does the math API have a minimizer?
>
> I have a curve of surface that is guaranteed to have one minimum.
> How would I use apache commons to find it?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[math] Minimizer

Posted by mi...@TaosNet.com.
Does the math API have a minimizer?

I have a curve of surface that is guaranteed to have one minimum.
How would I use apache commons to find it?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: how it works jxpathcontext removeall?bug?

Posted by liumin HU <lh...@sigems.fr>.
No one has a idea? Is it a bug of JXPath?

Or Someone tell me how to remove, please.

Thanks in advance.

liu

PS: I am using jxpath 1.2
----- Original Message ----- 
From: "liumin HU" <lh...@sigems.fr>
To: <us...@commons.apache.org>
Sent: Monday, December 31, 2007 12:11 PM
Subject: how it works jxpathcontext removeall?


hi everyone,

I use jxpath to manage an ArrayList of bean, the Context is created like: 
JXPathContext context=JXPathContext.newContext(list);

When I want to delete some objects in the arraylist, i used 
context.removeall, but it doesn't work.
Before and after call of removeall, the value of count is always 1.

context.getVariables().declareVariable("heure", _h);
System.out.println(context.getValue("count(/.[heureSelected=$heure])")); 
====> 1.0
context.removePath("/.[heureSelected=$heure]");
System.out.println(context.getValue("count(/.[heureSelected=$heure])")); 
====> 1.0

I tried too iterator.remove(), i got a exception.

Iterator<HeurePrescription> iter = 
context.iterate("/.[heureSelected=$heure]");
 while(iter.hasNext()){
     iter.next();
     iter.remove();
 }

Any help is appreciated.

Thanks in advance

Liu 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: how it works jxpathcontext removeall?

Posted by liumin HU <lh...@sigems.fr>.
hi,
yes, I am using 1.2 release.

liu
----- Original Message ----- 
From: "Matt Benson" <gu...@yahoo.com>
To: "Jakarta Commons Users List" <us...@commons.apache.org>
Sent: Monday, December 31, 2007 5:00 PM
Subject: Re: how it works jxpathcontext removeall?


>
> --- liumin HU <lh...@sigems.fr> wrote:
>
>> hi everyone,
>>
>> I use jxpath to manage an ArrayList of bean, the
>> Context is created like: JXPathContext
>> context=JXPathContext.newContext(list);
>>
>> When I want to delete some objects in the arraylist,
>> i used  context.removeall, but it doesn't work.
>> Before and after call of removeall, the value of
>> count is always 1.
>>
>> context.getVariables().declareVariable("heure", _h);
>>
> System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
>>  ====> 1.0
>> context.removePath("/.[heureSelected=$heure]");
>>
> System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
>> ====> 1.0
>>
>> I tried too iterator.remove(), i got a exception.
>>
>> Iterator<HeurePrescription> iter =
>> context.iterate("/.[heureSelected=$heure]");
>>  while(iter.hasNext()){
>>      iter.next();
>>      iter.remove();
>>  }
>>
>> Any help is appreciated.
>>
>> Thanks in advance
>
> Are you using the JXPath 1.2 release?  There are
> innumerable bugfixes in svn trunk.
>
> -Matt
>
>>
>> Liu
>
>
>
> 
> ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: JXpath for retrieving objects which are instanceof a particular class

Posted by liumin HU <lh...@sigems.fr>.
No, i dont think so.
----- Original Message ----- 
From: "Archit P" <Ar...@mastek.com>
To: "Jakarta Commons Users List" <us...@commons.apache.org>
Sent: Wednesday, January 02, 2008 11:29 AM
Subject: RE: JXpath for retrieving objects which are instanceof a particular 
class



Thanks liumin for help. But will this xpath take care of inherited Objects 
too?
As in I want to search for Objects that extend from some Class. For e.g. in 
the object hierarchy, I want to retrieve Objects that inherit (can be 
multi-level inheritance) from a particular class.


Regards,
Archit
Core-Elixir
PUNE
"Real Programmers always confuse Christmas and Halloween because Oct31 == 
Dec25.."


-----Original Message-----
From: liumin HU [mailto:lhu@sigems.fr]
Sent: Wednesday, January 02, 2008 3:16 PM
To: Jakarta Commons Users List
Subject: Re: JXpath for retrieving objects which are instanceof a particular 
class

hi,

i think [class/name=$classwanted] could work.


----- Original Message -----
From: "Archit P" <Ar...@mastek.com>
To: "Jakarta Commons Users List" <us...@commons.apache.org>
Sent: Wednesday, January 02, 2008 9:38 AM
Subject: JXpath for retrieving objects which are instanceof a particular
class



Hi,

I am new to JXPath and could not find the answer to my question on the
group. Please excuse if the question is too trivial.

I need to write an XPath that will retrieve objects that are instanceof a
particular class. I wrote a custom extension function for it. It works but I
just wanted to know if there is any better way of doing the same.

Regards,

Archit
"Real Programmers always confuse Christmas and Halloween because Oct31 ==
Dec25.."

MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that
of Mastek Limited, unless specifically indicated to that effect. Mastek
Limited does not accept any responsibility or liability for it. This e-mail
and attachments (if any) transmitted with it are confidential and/or
privileged and solely for the use of the intended person or entity to which
it is addressed. Any review, re-transmission, dissemination or other use of
or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. This e-mail and
its attachments have been scanned for the presence of computer viruses. It
is the responsibility of the recipient to run the virus check on e-mails and
attachments before opening them. If you have received this e-mail in error,
kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org



MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that 
of Mastek Limited, unless specifically indicated to that effect. Mastek 
Limited does not accept any responsibility or liability for it. This e-mail 
and attachments (if any) transmitted with it are confidential and/or 
privileged and solely for the use of the intended person or entity to which 
it is addressed. Any review, re-transmission, dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. This e-mail and 
its attachments have been scanned for the presence of computer viruses. It 
is the responsibility of the recipient to run the virus check on e-mails and 
attachments before opening them. If you have received this e-mail in error, 
kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


RE: JXpath for retrieving objects which are instanceof a particular class

Posted by Archit P <Ar...@mastek.com>.
Thanks liumin for help. But will this xpath take care of inherited Objects too?
As in I want to search for Objects that extend from some Class. For e.g. in the object hierarchy, I want to retrieve Objects that inherit (can be multi-level inheritance) from a particular class.


Regards,
Archit
Core-Elixir
PUNE
"Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25.."


-----Original Message-----
From: liumin HU [mailto:lhu@sigems.fr]
Sent: Wednesday, January 02, 2008 3:16 PM
To: Jakarta Commons Users List
Subject: Re: JXpath for retrieving objects which are instanceof a particular class

hi,

i think [class/name=$classwanted] could work.


----- Original Message -----
From: "Archit P" <Ar...@mastek.com>
To: "Jakarta Commons Users List" <us...@commons.apache.org>
Sent: Wednesday, January 02, 2008 9:38 AM
Subject: JXpath for retrieving objects which are instanceof a particular
class



Hi,

I am new to JXPath and could not find the answer to my question on the
group. Please excuse if the question is too trivial.

I need to write an XPath that will retrieve objects that are instanceof a
particular class. I wrote a custom extension function for it. It works but I
just wanted to know if there is any better way of doing the same.

Regards,

Archit
"Real Programmers always confuse Christmas and Halloween because Oct31 ==
Dec25.."

MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that
of Mastek Limited, unless specifically indicated to that effect. Mastek
Limited does not accept any responsibility or liability for it. This e-mail
and attachments (if any) transmitted with it are confidential and/or
privileged and solely for the use of the intended person or entity to which
it is addressed. Any review, re-transmission, dissemination or other use of
or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. This e-mail and
its attachments have been scanned for the presence of computer viruses. It
is the responsibility of the recipient to run the virus check on e-mails and
attachments before opening them. If you have received this e-mail in error,
kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org



MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: JXpath for retrieving objects which are instanceof a particular class

Posted by liumin HU <lh...@sigems.fr>.
hi,

i think [class/name=$classwanted] could work.


----- Original Message ----- 
From: "Archit P" <Ar...@mastek.com>
To: "Jakarta Commons Users List" <us...@commons.apache.org>
Sent: Wednesday, January 02, 2008 9:38 AM
Subject: JXpath for retrieving objects which are instanceof a particular 
class



Hi,

I am new to JXPath and could not find the answer to my question on the 
group. Please excuse if the question is too trivial.

I need to write an XPath that will retrieve objects that are instanceof a 
particular class. I wrote a custom extension function for it. It works but I 
just wanted to know if there is any better way of doing the same.

Regards,

Archit
"Real Programmers always confuse Christmas and Halloween because Oct31 == 
Dec25.."

MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that 
of Mastek Limited, unless specifically indicated to that effect. Mastek 
Limited does not accept any responsibility or liability for it. This e-mail 
and attachments (if any) transmitted with it are confidential and/or 
privileged and solely for the use of the intended person or entity to which 
it is addressed. Any review, re-transmission, dissemination or other use of 
or taking of any action in reliance upon this information by persons or 
entities other than the intended recipient is prohibited. This e-mail and 
its attachments have been scanned for the presence of computer viruses. It 
is the responsibility of the recipient to run the virus check on e-mails and 
attachments before opening them. If you have received this e-mail in error, 
kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


JXpath for retrieving objects which are instanceof a particular class

Posted by Archit P <Ar...@mastek.com>.
Hi,

I am new to JXPath and could not find the answer to my question on the group. Please excuse if the question is too trivial.

I need to write an XPath that will retrieve objects that are instanceof a particular class. I wrote a custom extension function for it. It works but I just wanted to know if there is any better way of doing the same.

Regards,

Archit
"Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25.."

MASTEK LTD.
Making a valuable difference
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: how it works jxpathcontext removeall?

Posted by Matt Benson <gu...@yahoo.com>.
--- liumin HU <lh...@sigems.fr> wrote:

> hi everyone,
> 
> I use jxpath to manage an ArrayList of bean, the
> Context is created like: JXPathContext
> context=JXPathContext.newContext(list);
> 
> When I want to delete some objects in the arraylist,
> i used  context.removeall, but it doesn't work. 
> Before and after call of removeall, the value of
> count is always 1.
> 
> context.getVariables().declareVariable("heure", _h);
>
System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
>  ====> 1.0
> context.removePath("/.[heureSelected=$heure]");
>
System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
> ====> 1.0
> 
> I tried too iterator.remove(), i got a exception.
>  
> Iterator<HeurePrescription> iter =
> context.iterate("/.[heureSelected=$heure]");
>  while(iter.hasNext()){
>      iter.next();
>      iter.remove();
>  }
> 
> Any help is appreciated.
> 
> Thanks in advance

Are you using the JXPath 1.2 release?  There are
innumerable bugfixes in svn trunk.

-Matt

> 
> Liu



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org