expression-templates Questions
1
Solved
I have this minimal expression template library with a multiplication, i.e.
template <typename T, typename U>
struct mul {
const T &v1;
const U &v2;
};
template <typename T, ty...
Smart asked 29/5, 2019 at 12:24
4
Solved
I would like to use the Eigen matrix library as the linear algebra engine in my program. Eigen uses expression templates to implement lazy evaluation and to simplify loops and calculations.
For ex...
Vanderhoek asked 11/6, 2012 at 7:58
2
I have been looking at changing some code to make use of QStringBuilder expression template for its purported performance improvements. Unfortunately this resulted in sections of my code starting t...
Festinate asked 9/9, 2015 at 10:5
5
Solved
The problem
Suppose we implement a string class which represents, uhm, strings. We then want to add an operator+ which concatenates two strings, and decide to implement that via expression templat...
Hannis asked 22/7, 2013 at 20:24
2
Expression templates are often used as an optimization technique to avoid the creation of temporary objects. They defer constructing the complete object until the template is used in an assignment ...
Huntsville asked 14/9, 2015 at 13:35
2
Solved
I have a set of operators that I need to override for expression templating. I would like all derived classes of a base type match to the base type. Other things would then be caught by a generic t...
Ealasaid asked 12/5, 2015 at 22:30
1
Solved
We are trying to implement a new C++ code in my research group to perform large numerical simulations (finite elements, finite difference methods, topology optimization, etc.) The software will be ...
Ellingston asked 10/3, 2015 at 16:9
2
Solved
Let's look at one particular benefit of expression templates: ETs can be used to avoid vector-sized temporaries in memory which occur in overloaded operators like:
template<typename T>
std::...
Mulberry asked 4/8, 2012 at 13:32
3
Given an expression template tree, I want to create a new optimized tree before processing it. Consider the following example of a multiplication operation:
a * b * c * d,
which produces, due to...
Actinism asked 13/8, 2013 at 15:29
2
I understand that doing something like the following:
auto&& x = Matrix1() + Matrix2() + Matrix3();
std::cout << x(2,3) << std::endl;
Will cause a silent runtime error if the...
Stetson asked 2/3, 2012 at 4:6
4
Solved
I've always been under the impression that for any comparison statement, i.e. X == Y or X != Y is the format, and you chain statements together with && or ||.
Is there not some way ...
Oligarchy asked 20/7, 2012 at 16:41
1
Solved
I am currently writing a C++ template expression library and comparing some instantiations with hand-written code at assembly level. The hand-written function is the following:
spinor multiply(vec...
Obstructionist asked 22/3, 2012 at 11:33
1
Solved
I incurred in a compiler dependent issue with the following code (stored in crtp.cc):
#include <vector>
#include <cassert>
#include <iostream>
template < class Derived >
c...
Caines asked 16/3, 2012 at 14:19
2
Solved
It is my understanding that expression templates will break on ranged based for in C++11, as for (auto x : expr) has an implicit auto&& __range = expr in it, and this will result in danglin...
Reconvert asked 1/3, 2012 at 1:51
2
Solved
I'm trying to make a grammar in Boost.Proto that matches a vector type, but when I give it a terminal of that type, it doesn't match the grammar. The type definition looks like this:
template <...
Seersucker asked 25/6, 2011 at 19:29
4
Solved
With the following code, "hello2" is not displayed as the temporary string created on Line 3 dies before Line 4 is executed. Using a #define as on Line 1 avoids this issue, but is there a way to av...
Lund asked 3/5, 2011 at 3:3
1
Solved
I have the first version of a math library completed, and for the next step I'd like to turn to expression templates to improve the performance of the code. However, my initial results are differen...
Rockyrococo asked 1/2, 2011 at 9:20
1
© 2022 - 2024 — McMap. All rights reserved.