Announcement

Collapse
No announcement yet.

C++14 Is Complete

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • nslay
    replied
    Originally posted by konserw View Post
    Also link to full reference documentation doesn't work. So uBLAST isn't the best example :P
    When I needed some matrix calculations for my university project i decided to use Eigen instead.

    Regardless my point is that if you need XYZ functionality and it is not part of the standard, you can find some lib which will do that for you.
    In that project we've (with my friend) used Eigen for matrixes, boost for serialization to xml files and Qt for GUI. All worked together fine

    If you want to have almost everything "in language" there's .NET or Java
    Oh come on. We're not even talking about widget toolkits, event loop API, SMTP API, Base64 API, etc... We're talking basic linear algebra. I would hardly bundle linear algebra with everything in one language that you refer to. We're talking something as common, general and useful as anything else in <cmath>!

    Leave a comment:


  • konserw
    replied
    Originally posted by Zan Lynx View Post
    I just checked Boost and uBLAS is part of Boost and so is already very nearly standard.
    Originally posted by http://www.boost.org/doc/libs/1_56_0/libs/numeric/ublas/doc/index.htm
    the last major improvement of uBLAS was in 2008 and no significant change was committed since 2009.
    Also link to full reference documentation doesn't work. So uBLAST isn't the best example :P
    When I needed some matrix calculations for my university project i decided to use Eigen instead.

    Regardless my point is that if you need XYZ functionality and it is not part of the standard, you can find some lib which will do that for you.
    In that project we've (with my friend) used Eigen for matrixes, boost for serialization to xml files and Qt for GUI. All worked together fine

    If you want to have almost everything "in language" there's .NET or Java

    Leave a comment:


  • matt_g
    replied
    Originally posted by nslay View Post
    From a numerics point of view, C++ is still about as usable as it was back in C++03. At least they expanded on random number generators.
    I've not used C++ for numerics but do use C and Fortran heavily. The problem is the same - many third party libs all with subtly different implementations

    The big libraries are stuff like GSL and good old NR

    I remember a few years ago I had to write my own Reinsch spline implementation in C and thought it was ridiculous there was not a standard one.

    Leave a comment:


  • Zan Lynx
    replied
    Originally posted by nslay View Post
    No, I didn't suggest the standard should solve everything for everyone. I suggested the standard provide common data structures and common algorithms for basic linear algebra for the majority use case. Come on, we're not talking about highly specialized problems like solving 10000x10000 sparse systems, or normalizing vectors super fast for games, we're talking small dense systems. Obviously, if you want to do something with specific performance requirements, you write your own or use a specialized library (just like anything else in the standard).

    Let's just put this into perspective: All sciences involve linear algebra (no exaggeration, ALL). This is especially the case on the computer. All your nice theory ends up in a vector space at some point. It really deserves some attention.
    It seems that the thing to do is to show that the library is useful and can be implemented well. Get it into Boost first, then try making it part of the C++ Standard.

    I just checked Boost and uBLAS is part of Boost and so is already very nearly standard.

    I'm so used to using Boost that if it is part of Boost it seems part of C++ already.

    Leave a comment:


  • nslay
    replied
    Originally posted by discordian View Post
    Basic alegra contains only addition and multiplication, or stuff like SVD, Determinant aswell? For the first, probably some generic for_each + iterators are the best solution and dont even depend on a type. The later ist so common IMHO, I would rather have some Galois field math for encrytion and error-correction than that.
    I dont think the distributions should be in the base library either but they are easier to seperate than stuff that depends on the types you use.

    Which is rather common for embedded (throw anything out that might allocate/free on its own) and gamedevs. Should your Point and Matrix manage its own memory, be a template parametrized on size or even fixed dimensions, should matrixes be sparse or full or both (two separate classes or one?)
    Theres alot of decisions that might be nice for one use but not for another.

    If you go down this road you end up with those bloated examples that try to solve anything for everyone and logically do this in a overly generic way everyone is unhappy. QT was already brought up, if you want a full environment for everything you should look at something like it.
    No, I didn't suggest the standard should solve everything for everyone. I suggested the standard provide common data structures and common algorithms for basic linear algebra for the majority use case. Come on, we're not talking about highly specialized problems like solving 10000x10000 sparse systems, or normalizing vectors super fast for games, we're talking small dense systems. Obviously, if you want to do something with specific performance requirements, you write your own or use a specialized library (just like anything else in the standard).

    Let's just put this into perspective: All sciences involve linear algebra (no exaggeration, ALL). This is especially the case on the computer. All your nice theory ends up in a vector space at some point. It really deserves some attention.

    Leave a comment:


  • curaga
    replied
    Originally posted by nslay View Post
    No, I maintain that each library that declares its own Point and Matrix class is almost equivalent to that library making it's own String class. It's downright stupid.
    Yet most big C++ libs do make their own strings: QString, UString, etc etc.

    Leave a comment:


  • discordian
    replied
    Originally posted by nslay View Post
    It's not just a small part of the users. Very basic linear algebra is extremely common. I would expect more usage of basic linear algebra than I would expect use std::erf, std::tgamma, std::lgamma (for example), or the entire <complex> header.
    Basic alegra contains only addition and multiplication, or stuff like SVD, Determinant aswell? For the first, probably some generic for_each + iterators are the best solution and dont even depend on a type. The later ist so common IMHO, I would rather have some Galois field math for encrytion and error-correction than that.
    I dont think the distributions should be in the base library either but they are easier to seperate than stuff that depends on the types you use.

    Originally posted by nslay View Post
    No, I maintain that each library that declares its own Point and Matrix class is almost equivalent to that library making it's own String class. It's downright stupid.
    Which is rather common for embedded (throw anything out that might allocate/free on its own) and gamedevs. Should your Point and Matrix manage its own memory, be a template parametrized on size or even fixed dimensions, should matrixes be sparse or full or both (two separate classes or one?)
    Theres alot of decisions that might be nice for one use but not for another.

    If you go down this road you end up with those bloated examples that try to solve anything for everyone and logically do this in a overly generic way everyone is unhappy. QT was already brought up, if you want a full environment for everything you should look at something like it.
    Last edited by discordian; 19 August 2014, 03:37 PM.

    Leave a comment:


  • nslay
    replied
    Originally posted by discordian View Post
    I dont think adding libraries that are of use for a rather small part of the users as standard makes sense. The Java`s and DotNets already proved how much of a mess this gets with several hundred megabytes of libraries in several incompatible versions. Unless there proves to be one way to make almost everyone happy, just keep those libs external. The fact that there are numerous numerics and Linear algebra libraries kinda implies that this isnt the case.

    Just think of how you would scale down the library for use on embedded targets, where C/C++ is often the only thing available. You can adopt a C/C++ Library by providing mabye 2 dozend of functions (malloc, filedescriptors, locks, threads).
    This is the nice thing of C/C++ - it runs anywhere, pulling in libraries for every occasion will make that harder.
    It's not just a small part of the users. Very basic linear algebra is extremely common. I would expect more usage of basic linear algebra than I would expect use std::erf, std::tgamma, std::lgamma (for example), or the entire <complex> header.

    No, I maintain that each library that declares its own Point and Matrix class is almost equivalent to that library making it's own String class. It's downright stupid.

    Leave a comment:


  • nslay
    replied
    Originally posted by Kemosabe View Post
    Well, Qt maps EVERYTHING. There is QList, QMap and i am very sure there is a QMatrix no matter std::matrix exists or not ...
    I am unsure whether a standard math lib is really 100% a good thing or not...
    You already reap the benefits of a standard math library. You can use std::sin, std::cos, std::tan, std::atan, std::atan2, std::acos, std::asin, std::sqrt, std::cbrt, std::log, std::log2, std::log10, etc...

    Did you also want to pull in your own implementation of these from external dependencies for some very common usage? Sure, there are special cases where you'd want to write your own or use an external package for performance reasons ... but we're talking the majority use case where the user has no explicit performance requirements for these.

    I think the same applies for basic linear algebra. The majority usage is probably solving small dense linear systems (oh, say 3x3, 4x4 systems), computing eigen/singular values, matrix/vector matrix/matrix multiplication, inner products, cross products, etc...



    Yup. VERY usable and flexible.
    C++11 is as flexible for numerics as it was with C++03. Nothing has changed (except for some extra functions like std::cbrt and the awesomely revamped RNG API) ... I still need to pull in dependencies to do these sorts of common computations and have to deal with several different implementations of these when using other libraries that have their own implementations. Seriously, this is dumb:

    namespace ThisLibrary {
    template<typename Tp>
    struct MyPoint {
    Tp x, y, z;
    };
    }

    namespace ThatLibrary {
    template<typename Tp>
    class YourPoint {
    private:
    Tp m_x, m_y, m_z;

    public:
    Tp & x();
    Tp & y();
    Tp & z();
    };
    }

    namespace OneOfAnyOtherThousandsOfWaysToImplementAPoint {
    ...
    }

    namespace YetAnotherMatrixPackage {
    class Matrix {
    ...
    };
    }

    This is stupid and everyone makes their own every time. These classes are probably almost as common strings (hence there's a std::string!).

    Leave a comment:


  • discordian
    replied
    Originally posted by nslay View Post
    Meanwhile, everyone continues to make their own Point and Matrix classes ... and their own numerics functions (like cross product). It's not a big deal until you start working with lots of other libraries that each have their own Point and Matrix class that you have to convert to/from.

    I seriously believe they should standardize a very basic N-D Point/Vector utility struct/class with basic operations (some of which exist with obscure names in <numeric>). The same goes with Matrix, and while contentious, I'm not suggesting to standardize some crazy sparse Matrix/Vector data structure but something that can be used to do, oh, solve small dense linear systems efficiently and in a numerically stable way. Maybe throw SVD and eigenvalue algorithms in there (everyone keeps rewriting these too ... let's see, Linpack, Lapack, OpenCV, Eigen ... am I missing any?).

    But yeah, QPoint, vnl_vector, vtkMatrix, vnl_matrix, QMatrix, boost? This is really really stupid. These utility classes and many algorithms associated with them are so common that they really should be standard.

    From a numerics point of view, C++ is still about as usable as it was back in C++03. At least they expanded on random number generators.
    I dont think adding libraries that are of use for a rather small part of the users as standard makes sense. The Java`s and DotNets already proved how much of a mess this gets with several hundred megabytes of libraries in several incompatible versions. Unless there proves to be one way to make almost everyone happy, just keep those libs external. The fact that there are numerous numerics and Linear algebra libraries kinda implies that this isnt the case.

    Just think of how you would scale down the library for use on embedded targets, where C/C++ is often the only thing available. You can adopt a C/C++ Library by providing mabye 2 dozend of functions (malloc, filedescriptors, locks, threads).
    This is the nice thing of C/C++ - it runs anywhere, pulling in libraries for every occasion will make that harder.

    Leave a comment:

Working...
X