I am having some trouble getting some overloaded operators working correctly with a simple inherited Vector class (numerical vector, not container) The scalar multiply from the base class doesn't appear to be visible to the derived class. Code follows: Base Class Header [code=c++]#pragma once #include <vector> class Base { protected: std::vector<double> val; public: Base(); Base( double v0, double v1, double v2 ); virtual ~Base(){} virtual Base operator*( const double scalar ) const; }; [/code] Base Class Implementation [code=c++] #include "base.h" using namespace std; Base::Base(){ val = vector<double>( 3, 0.0 ); } Base::Base( double v0, double v1, double v2 ){ val … |
+0 forum
10 | ||

In my application, i currently make many (parallel) calculations based on a time parameter. The calculation is a parametric function of time, so, each time value renders a unique solution. Currently, I have many threads that are calling the same calculation function, and the time parameters are often the same. The calculations can take some considerable amount of time. I want to optimize by adding a hash-table like structure. So, instead of calculating and recalculating for identical times across many threads, I would prefer storing the calculation results in a hash-table keyed by the time. My application currently uses the … |
+0 forum
1 |

The End.