Search Results

Search found 575 results on 23 pages for 'aaa'.

Page 9/23 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • C++, name collision across different namespace

    - by aaa
    hello. I am baffled by the following name collision: namespace mp2 { boost::numeric::ublas::matrix_range<M> slice(M& m, const R1& r1, const R2& r2) { namespace ublas = boost::numeric::ublas; ublas::range r1_(r1.begin(), r1.end()), r2_(r2.begin(), r2.end()); return ublas::matrix_range<M>(m, r1_, r2_); } double energy(const Wavefunction &wf) { const Wavefunction::matrix& C = wf.coefficients(); int No = wf.occupied().size(); foreach (const Basis::MappedShell& P, basis.shells()) { slice(C, range(No), range(P)); the error from g++4.4 is 7 In file included from mp2.cpp:1: 8 /usr/include/boost/numeric/ublas/fwd.hpp: In function âdouble mp2::energy(const Wavefunction&)â: 9 /usr/include/boost/numeric/ublas/fwd.hpp:32: error: âboost::numeric::ublas::sliceâ is not a function, 10 ../../src/mp2/energy.hpp:98: error: conflict with âtemplate<class M, class R1, class R2> boost::numeric::ublas::matrix_range<M> mp2::slice(M&, const R1&, const R2&)â 11 ../../src/mp2/energy.hpp:123: error: in call to âsliceâ 12 /usr/include/boost/numeric/ublas/fwd.hpp:32: error: âboost::numeric::ublas::sliceâ is not a function, 13 ../../src/mp2/energy.hpp:98: error: conflict with âtemplate<class M, class R1, class R2> boost::numeric::ublas::matrix_range<M> mp2::slice(M&, const R1&, const R2&)â 14 ../../src/mp2/energy.hpp:129: error: in call to âsliceâ 15 make: *** [mp2.lo] Error 1 ublas segment is namespace boost { namespace numeric { namespace ublas { typedef basic_slice<> slice; why is slice in ublas collides with slice in mp2? I and fairly certain there is no using namespace ublas in the code and in includes. thank you

    Read the article

  • Expert system for writing programs?

    - by aaa
    I am brainstorming an idea of developing a high level software to manipulate matrix algebra equations, tensor manipulations to be exact, to produce optimized C++ code using several criteria such as sizes of dimensions, available memory on the system, etc. Something which is similar in spirit to tensor contraction engine, TCE, but specifically oriented towards producing optimized rather than general code. The end result desired is software which is expert in producing parallel program in my domain. Does this sort of development fall on the category of expert systems? What other projects out there work in the same area of producing code given the constraints?

    Read the article

  • Multithreading, when to yield versus sleep

    - by aaa
    hello. To clarify terminology, yield is when thread gives up its time slice. My platform of interest is POSIX threads, but I think question is general. Suppose I have consumer/producer pattern. If I want to throttle either consumer or producer, which is better to use, sleep or yield? I am mostly interested in efficiency of using either function. Thanks

    Read the article

  • oprofile unable to produce call graph

    - by aaa
    hello I am trying to use oprofile to generate call graph. Compiler is g++, platform is linux x86-64, linker is gfortran C++ code is compiled with -fno- omit-frame-pointer. oprofile is started with --callgraph=25. report I run with --callgraph. the call graph is produced but it's only includes self time, which is not much use what am I missing?

    Read the article

  • UV-vis detector [Hardware]

    - by aaa
    hello. This is not hundred percent programming related question, but I was not able to find answer on the net. Is there some kind of detector to record frequency/intensity of light radiation source? something like spectroscopy detector, but instead of actual machine, just the module which can be integrated in project. I have tried searching on Google but I do not even know what such device is called if you know the more appropriate place to ask, can you let me know please. Thank you

    Read the article

  • C++ performance, for versus while

    - by aaa
    hello. In general (or from your experience), is there difference in performance between for and while loops? What if they are doubly/triply nested? Is vectorization (SSE) affected by loop variant in g++ or Intel compilers? Thank you

    Read the article

  • C++ boost ublas + units dimension constraints

    - by aaa
    hello. I am seeking advice on design/general idea on how to force matrix dimension constraints on ublas matrix/vector possibly using boost units. For example, let matrix A have dimensions of time x force (for example) // does not have dimensions, time x force and force x time are not distinguished. matrix<double> A; //something like? dimension<time, force, matrix<double> > A; dimension<force, time, matrix<double> > B = trans(A); have you done something like this or do you have some good idea about how to organize such constraints? Thank you

    Read the article

  • C++ domain specific embedded language operators

    - by aaa
    hi. In numerical oriented languages (Matlab, Fortran) range operator and semantics is very handy when working with multidimensional data. For example: A(i:j,k,:n) // represents two-dimensional slice B(i:j,0:n) of A at index k unfortunately C++ does not have range operator (:). of course it can be emulated using range/slice functor, but semantics is less clean than Matlab. I am prototyping matrix/tensor domain language in C++ and am wondering if there any options to reproduce range operator. I still would like to rely on C++/prprocessor framework exclusively. So far I have looked through boost wave which might be an suitable option. is there any other means to introduce new operators to C++ DSL?

    Read the article

  • boost::enable_if class template method

    - by aaa
    I got class with template methods that looks at this: struct undefined {}; template<typename T> struct is_undefined : mpl::false_ {}; template<> struct is_undefined<undefined> : mpl::true_ {}; template<class C> struct foo { template<class F, class V> typename boost::disable_if<is_undefined<C> >::type apply(const F &f, const V &variables) { } template<class F, class V> typename boost::enable_if<is_undefined<C> >::type apply(const F &f, const V &variables) { } }; apparently, both templates are instantiated, resulting in compile time error. is instantiation of template methods different from instantiation of free functions? I have fixed this differently, but I would like to know what is up. Thank you

    Read the article

  • C++ CRTP(template pattern) question

    - by aaa
    following piece of code does not compile, the problem is in T::rank not be inaccessible (I think) or uninitialized in parent template. Can you tell me exactly what the problem is? is passing rank explicitly the only way? or is there a way to query tensor class directly? Thank you #include <boost/utility/enable_if.hpp> template<class T, // size_t N, class enable = void> struct tensor_operator; // template<class T, size_t N> template<class T> struct tensor_operator<T, typename boost::enable_if_c< T::rank == 4>::type > { tensor_operator(T &tensor) : tensor_(tensor) {} T& operator()(int i,int j,int k,int l) { return tensor_.layout.element_at(i, j, k, l); } T &tensor_; }; template<size_t N, typename T = double> // struct tensor : tensor_operator<tensor<N,T>, N> { struct tensor : tensor_operator<tensor<N,T> > { static const size_t rank = N; }; I know the workaround, however am interested in mechanics of template instantiation for self-education

    Read the article

  • C++ ambiguous template instantiation

    - by aaa
    the following gives me ambiguous template instantiation with nvcc (combination of EDG front-end and g++). Is it really ambiguous, or is compiler wrong? I also post workaround à la boost::enable_if template<typename T> struct disable_if_serial { typedef void type; }; template<> struct disable_if_serial<serial_tag> { }; template<int M, int N, typename T> __device__ //static typename disable_if_serial<T>::type void add_evaluate_polynomial1(double *R, const double (&C)[M][N], double x, const T &thread) { // ... } template<size_t M, size_t N> __device__ static void add_evaluate_polynomial1(double *R, const double (&C)[M][N], double x, const serial_tag&) { for (size_t i = 0; i < M; ++i) add_evaluate_polynomial1(R, C, x, i); } // ambiguous template instantiation here. add_evaluate_polynomial1(R, C, x, serial_tag());

    Read the article

  • syntax to express mathematical formula concisely in your language of choice

    - by aaa
    hello. I am developing functional domain specific embedded language within C++ to translate formulas into working code as concisely and accurately as possible. Right now my language looks something like this: // implies two nested loops j=0:N, i=0,j (range(i) < j < N)[T(i,j) = (T(i,j) - T(j,i))/e(i+j)]; // implies summation over above expression sum(range(i) < j < N))[(T(i,j) - T(j,i))/e(i+j)]; I am looking for possible syntax improvements/extensions or just different ideas about expressing mathematical formulas as clearly and precisely as possible. Can you give me some syntax examples relating to my question which can be accomplished in your language of choice which consider useful. In particular, if you have some ideas about how to translate the above code segments, I would be happy to hear them Thank you

    Read the article

  • C++ catch constructor exception

    - by aaa
    hi. I do not seem to understand how to catch constructor exception. Here is relevant code: struct Thread { rysq::cuda::Fock fock_; template<class iterator> Thread(const rysq::cuda::Centers &centers, const iterator (&blocks)[4]) : fock_() { if (!fock_) throw; } }; Thread *ct; try { ct = new Thread(centers_, blocks); } catch(...) { return false; } // catch never happens, So catch statement do not execute and I get unhandled exception. What did I do wrong? this is straight C++ using g++.

    Read the article

  • C++ template parameter/class ambiguity

    - by aaa
    hello. while testing with different version of g++, the following problem came up template<class bra> struct Transform<bra, void> : kernel::Eri::Transform::bra { static const size_t ni = bra::A::size; bra::A is interpreted as kernel::Eri::Transform::bra::A, rather than template argument by g++ 4.1.2. on the other hand, g++ 4.3 gets it right. what should be correct behavior according to standard? Meanwhile, I refactor slightly to make problem go away.

    Read the article

  • C++ auto function return type implementation

    - by aaa
    hello. Is there macro, something like BOOST_AUTO, which would allow to emulate automatic return type deduction of function in C++? I mean something like trailing-return-type, http://en.wikipedia.org/wiki/C%2B%2B0x#Alternative_function_syntax thank you

    Read the article

  • C instruction address

    - by aaa
    hello. Disclaimer, I not do anything in particular with regards this question, just curious. Is it possible to take address of instruction or block in C? in essence, is there jump equivalent in C? for example: void function() { int k; { // is a possible to go to this address from arbitrary point in code? int i, j; k += j+i; } } thank you

    Read the article

  • Is it possible to reinterpret pointer as dimensioned array reference?

    - by aaa
    hi. Suppose I have some pointer, which I want to reinterpret as static dimension array reference: double *p; double (&r)[4] = ?(p); // some construct? // clarify template< size_t N> void function(double (&a)[N]); ... double *p; function(p); // this will not work. // I would like to cast p as to make it appear as double[N] Is it possible to do so? how do I do it?

    Read the article

  • C++ compilers and back/front ends

    - by aaa
    Hello. for my own education I am curious what compilers use which C++ front-end and backend. Can you enlighten me where the following technologies are used and what hallmarks/advantages they have if any? Open64 - is it backend, front-end, or both? Which compilers use it? I encounter it in cuda compiler. EDG - as far as I can tell this is a backend use by Intel compilers and Comeau. do other compilers use it? I found quite a few references to it in boost source code. ANTLR - this is general parser. Do any common compilers use it? Regarding compilers: with front-end/backend does gcc compiler suite uses? does it have common heritage with any other compiler? what front-end/backend PGI and PathScale compilers use? what front-end/backend XL compiler uses (IBM offering). Thanks.

    Read the article

  • C++ Boost bind value type

    - by aaa
    hello. I look in documentation and source code but cannot figure out how to get return value type of boost bind functor. I am trying to accomplish following: 35 template<typename T,size_t N, class F> 36 boost::array<typename F::value_type, N> make_array(T (&input)[N], F unary) { 37 boost::array<typename F::value_type, N> array; 38 std::transform(input, input + N, array.begin(), unary); 39 return array; 40 } where F can be bind functor. the above does not work because functor does not have value_type. for that matter, is there standard interface for unary/binary functor as far as return value. Thanks

    Read the article

  • create XSD for element with same name

    - by aaa
    how to make xsd for element with same names that only identifyed by attribute value example :- <a> <b n="structure one"> <c n="inner element 1"/> <c n="inner element 2"/> <c n="inner element 3"/> </b> <b n="structure two"> <c n="inner element 1 for structure two"/> <c n="inner element 2 for structure two"/> <c n="inner element 3 for structure two"/> </b> </a> notice that from the XML i have to mention specific value that belong to the inner element same for structure

    Read the article

  • Nested loop with dependent bounds trip count

    - by aaa
    hello. just out of curiosity I tried to do the following, which turned out to be not so obvious to me; Suppose I have nested loops with runtime bounds, for example: t = 0 // trip count for l in 0:N for k in 0:N for j in max(l,k):N for i in k:j+1 t += 1 t is loop trip count is there a general algorithm/way (better than N^4 obviously) to calculate loop trip count? I am working on the assumption that the iteration bounds depend only on constant or previous loop variables.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >