Add squared norm convenience function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Add squared norm convenience function

Ronald Wampler
Hi,

I was wondering if it would be possible to add a function to calculate
the squared norm? While it's easy to implement one's own version,
it occurs fairly frequently (e.g., in optimization problems) that it
would be nice to have. I would be happy to provide a patch if there is
interest.

Ron
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Add squared norm convenience function

Nasos Iliopoulos
By all means please provide a pull request at the "develop" branch.

Take a look at these instructions:
https://github.com/uBLAS/ublas/wiki

Remember to replace the ublas/ublas repository with your forked
repository in step 3 under "Compiling and running the unit tests:".

-Nasos





On 03/07/2016 01:03 PM, Ronald Wampler wrote:

> Hi,
>
> I was wondering if it would be possible to add a function to calculate
> the squared norm? While it's easy to implement one's own version,
> it occurs fairly frequently (e.g., in optimization problems) that it
> would be nice to have. I would be happy to provide a patch if there is
> interest.
>
> Ron
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Add squared norm convenience function

Ronald Wampler
Thanks for the instructions.

I ran into one issue with building the test.

I am on Mac OS X using clang and I get the following error when
compiling "concepts.hpp" :

clang: error: unknown argument: '-fabi-version=0'

clang doesn't support this flag, but the jam file is adding this base
on the darwin toolset. This setting was added 6 years ago so gcc would
have been the default compile on Mac OS X. In order to determine an
appropriate fix, for the darwin toolset is clang expected to be the
default compiler now for all boost libraries? I imagine we could check
if the user is compiling with darwin/gcc vs darwin/clang.

Ron

On Mon, Mar 7, 2016 at 3:03 PM, Nasos Iliopoulos <[hidden email]> wrote:

> By all means please provide a pull request at the "develop" branch.
>
> Take a look at these instructions:
> https://github.com/uBLAS/ublas/wiki
>
> Remember to replace the ublas/ublas repository with your forked repository
> in step 3 under "Compiling and running the unit tests:".
>
> -Nasos
>
>
>
>
>
>
> On 03/07/2016 01:03 PM, Ronald Wampler wrote:
>>
>> Hi,
>>
>> I was wondering if it would be possible to add a function to calculate
>> the squared norm? While it's easy to implement one's own version,
>> it occurs fairly frequently (e.g., in optimization problems) that it
>> would be nice to have. I would be happy to provide a patch if there is
>> interest.
>>
>> Ron
>> _______________________________________________
>> ublas mailing list
>> [hidden email]
>> http://lists.boost.org/mailman/listinfo.cgi/ublas
>> Sent to: [hidden email]
>
>
> _______________________________________________
> ublas mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: [hidden email]
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Add squared norm convenience function

Nasos Iliopoulos
I've been compiling with clang and never had this problem. Also the
regression tests
(http://www.boost.org/development/tests/develop/developer/numeric-ublas.html)
don't show any issues with clang. It might be a problem with XCode if
you are using it.

Can you locally try to modify the jam file to include this to bypass
giving an error on warnings?

-Wno-error=unused-command-line-argument-hard-error-in-future



-Nasos

On 03/08/2016 02:08 PM, Ronald Wampler wrote:
> or all boost libraries?

_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Add squared norm convenience function

Ronald Wampler
On Wed, Mar 9, 2016 at 8:06 AM, Nasos Iliopoulos <[hidden email]> wrote:

> I've been compiling with clang and never had this problem. Also the
> regression tests
> (http://www.boost.org/development/tests/develop/developer/numeric-ublas.html)
> don't show any issues with clang. It might be a problem with XCode if you
> are using it.
>
> Can you locally try to modify the jam file to include this to bypass giving
> an error on warnings?
>
> -Wno-error=unused-command-line-argument-hard-error-in-future
>
Adding this still gives an error. I also tried using an older version of
Apple's clang (Apple LLVM version 7.0.0 (clang-700.0.72) with no luck. This is
older than the one used for the regression testing so it looks like Apple stop
supporting unused command line arguments for sometime now.

I was able to compile without any issues using the clang-darwin toolset as
shown in the regression tests. So it looks like the clang-darwin toolset
ignores this line:

<toolset>darwin:<cxxflags>"-fabi-version=0"

I believe the other toolset (darwin-5.3.0) listed in regression test is
actually configured to use g++-5.3.0 since the generic darwin toolset defaults
to /usr/bin/g++ which is just a shim to clang.

So it seems that the issue is that the generic darwin toolset defaults to
/usr/bin/g++ which is just a shim to clang.

BTW, removing that line and compiling with g++-5.3.0, the tests still
pass.

Ron
_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]