Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: encrypt and decrypt Pin
Stuart Dootson16-Jan-09 2:22
professionalStuart Dootson16-Jan-09 2:22 
AnswerRe: encrypt and decrypt Pin
Hamid_RT18-Jan-09 22:52
Hamid_RT18-Jan-09 22:52 
Questionarrays & speed Pin
misterMF16-Jan-09 1:03
misterMF16-Jan-09 1:03 
AnswerRe: arrays & speed Pin
Roger Stoltz16-Jan-09 1:17
Roger Stoltz16-Jan-09 1:17 
AnswerRe: arrays & speed Pin
Stuart Dootson16-Jan-09 2:17
professionalStuart Dootson16-Jan-09 2:17 
GeneralRe: arrays & speed Pin
Luc Pattyn16-Jan-09 2:32
sitebuilderLuc Pattyn16-Jan-09 2:32 
AnswerRe: arrays & speed Pin
Joe Woodbury16-Jan-09 21:35
professionalJoe Woodbury16-Jan-09 21:35 
AnswerRe: arrays & speed Pin
misterMF18-Jan-09 22:51
misterMF18-Jan-09 22:51 
Thank you very much for your precious suggestions Smile | :) . I'll start with the implementation to see where the bottlenecks are.

I'll start declaring my class more or less like this:

template< typename T >
class TTransferMatrix < std::valarray<t>> : public TTransferMatrix_base < std::valarray<t>>
{

private:
	const size_t N_ELEMENTS;    // the size of the matrices (always 2*2 = 4)
	size_t arraySize;           // the number of matrices in the array
	
       std::valarray< T > m00;	    // the matrix elements: since they are a lot
	std::valarray< T > m01;     // it can be better to use separate variables (?)
	std::valarray< T > m10;
	std::valarray< T > m11;

public:
        // public members (ctors, destructors, operators & functions)
}
</t></t>


In the template, <t> can be any basic type. In my application, I'll need to work complex numbers.

Do you think that STD::VALARRAY is a good choice as the basic container?

I know that the STD::VALARRAY class is not really optimized for numerics (as they would like us to believe...), but I performed some tests long time ago and I noticed that filling/reading a STD::VALARRAY was faster than using STD::VECTOR.
QuestionHeap corruption during heavy calculation in 2 threads [modified to include url] Pin
Roger Allen16-Jan-09 0:06
Roger Allen16-Jan-09 0:06 
AnswerRe: Heap corruption during heavy calculation in 2 threads Pin
Code-o-mat16-Jan-09 0:46
Code-o-mat16-Jan-09 0:46 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen16-Jan-09 2:33
Roger Allen16-Jan-09 2:33 
AnswerRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz16-Jan-09 0:54
Roger Stoltz16-Jan-09 0:54 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen16-Jan-09 2:37
Roger Allen16-Jan-09 2:37 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz16-Jan-09 3:11
Roger Stoltz16-Jan-09 3:11 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen16-Jan-09 3:15
Roger Allen16-Jan-09 3:15 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz16-Jan-09 4:33
Roger Stoltz16-Jan-09 4:33 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen16-Jan-09 5:15
Roger Allen16-Jan-09 5:15 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz16-Jan-09 9:09
Roger Stoltz16-Jan-09 9:09 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen19-Jan-09 1:23
Roger Allen19-Jan-09 1:23 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen20-Jan-09 0:02
Roger Allen20-Jan-09 0:02 
AnswerRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz20-Jan-09 1:19
Roger Stoltz20-Jan-09 1:19 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Randor 16-Jan-09 6:26
professional Randor 16-Jan-09 6:26 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Stoltz16-Jan-09 9:04
Roger Stoltz16-Jan-09 9:04 
AnswerRe: Heap corruption during heavy calculation in 2 threads Pin
Stuart Dootson16-Jan-09 1:07
professionalStuart Dootson16-Jan-09 1:07 
GeneralRe: Heap corruption during heavy calculation in 2 threads Pin
Roger Allen16-Jan-09 2:41
Roger Allen16-Jan-09 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.