Re: [math] discuss faster getEntry for RealMatrix implementations

2023-03-04 Thread Cyril de Catheu
Thanks for the quick answer!
↓

On Sat, Mar 4, 2023 at 2:39 PM Gilles Sadowski  wrote:

> Hello.
>
> Le sam. 4 mars 2023 à 12:29, Cyril de Catheu
>  a écrit :
> >
> > Hello,
> >
> > I just opened a ticket
>
> Thanks for the report!
>
> > describing an opportunity to optimize the getEntry
> > method of RealMatrix implementations.
> > For our specific workload in BOBYQA
>
> Advertisement: Help is very welcome for maintaining the
> implementation of that algorithm.[1]
>

Ok I had a look at the tickets, looks interesting. I'd be happy to help
maintain the implementation.
I've recently worked on java code generated from fortran. It seems to be
the case in this implementation - special mention for the infinite loop +
switch acting as a GOTO x) .
I'll start by refactoring.


> > this seems to be a ~10% speed
> > improvement.
> > I think it could also give a (variable) speed up to every consumer of
> > RealMatrix.getEntry.
> >
> > https://issues.apache.org/jira/browse/MATH-1654
>
> Thanks for the analysis.
>
> Side note: You are most welcome to contribute to having JMH
> benchmarks integrated within the component's repository.[2]
>

Noted. Maybe later.


> > If changing RealMatrix implems is not an option, there are other specific
> > solutions to optimize the BOBYQA optimizer.
> >
> > Let me know what you think.
>
> I've also added comments on JIRA.
>

Somehow I can't see any comments on JIRA -
https://issues.apache.org/jira/browse/MATH-1654
Am I missing something?

Regards.
Cyril


> Best regards,
> Gilles
>
> [1] Cf. related issues in JIRA (and in the ML archive).
> [2] By coincidence, another discussion has just been restarted about
>  it (for another functionality):
>  https://issues.apache.org/jira/browse/MATH-1585
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


[math] discuss faster getEntry for RealMatrix implementations

2023-03-04 Thread Cyril de Catheu
Hello,

I just opened a ticket describing an opportunity to optimize the getEntry
method of RealMatrix implementations.
For our specific workload in BOBYQA this seems to be a ~10% speed
improvement.
I think it could also give a (variable) speed up to every consumer of
RealMatrix.getEntry.

https://issues.apache.org/jira/browse/MATH-1654

If changing RealMatrix implems is not an option, there are other specific
solutions to optimize the BOBYQA optimizer.

Let me know what you think.

Have a nice week-end.
Cyril de Catheu


Fwd: [text] StringSubstitutor checks for cycles even if substitution in variables is disabled

2022-12-28 Thread Cyril de Catheu
Hello,

I shared this issue on the user ML a few weeks ago.
If it's ok I'll start working on a fix for this.
Ticket is here https://issues.apache.org/jira/browse/TEXT-223.

Happy holidays.

-- Forwarded message -----
From: Cyril de Catheu 
Date: Fri, Nov 4, 2022 at 12:12 AM
Subject: [text] StringSubstitutor checks for cycles even if substitution in
variables is disabled
To: 


Hello,

I'm trying to use StringSubstitutor. Substitution in variables (recursive
substitution) is disabled.
When I run with a variable cycle, I don't expect an infinite loop because
recursive substitution is disabled. But I still get the exception:
java.lang.IllegalStateException: Infinite loop in property interpolation of
my template ${cycle}: cycle.

See example code below.

import java.util.Map;
import org.apache.commons.text.StringSubstitutor;

public class TestCycles {

  public static void main(String[] args) {
final Map cycleMap = Map.of("cycle", "${cycle}");
final StringSubstitutor sub = new StringSubstitutor(cycleMap)
.setEnableSubstitutionInVariables(false);
  String res =  sub.replace("my template ${cycle}");
  }
}


Is this the expected behavior, or do you think this should be fixed?

Thanks.

-- 

[image: StarTree] <https://startree.ai>
Cyril de Catheu
Software Engineer
+33 (684) 829-908 <+33+(684)+829-908>
Follow us: [image: RSS] <https://www.startree.ai/blogs>[image: LinkedIn]
<https://www.linkedin.com/company/startreedata/>[image: Twitter]
<https://twitter.com/startreedata>[image: Slack]
<https://stree.ai/slack>[image:
YouTube] <https://youtube.com/StarTreeData>

[image: Try StarTree Cloud Today]
<https://get.startree.ai/startree-cloud?utm_campaign=byoc-edition-of-startree-cloud&utm_source=email&utm_content=startree-employee-email-signatures>