Daniel Duffy
C++ author, trainer
- Joined
- 10/4/07
- Messages
- 10,223
- Points
- 648
What are the applications in finance for fixed-size matrices?
I can't think of something off the top of my head. Overly-simplistic examples I could think of.What are the applications in finance for fixed-size matrices?
I didn't know of expression templates, pretty cool - so essentially you create an expression tree using these proxy objects and when the template is repetitively instantiated, it becomes like a single operation instead of multiple computations with temporary objects.Always good to think of problems up front. Otherwise it's a solution looking for a problem.
Tiny Vector Matrix library using Expression Templates
This Tiny Vector and Matrix C++ template libary uses Meta Templates and Expression Templates to evaluate results at compile time - to make it fast for low order (tiny) systems.tvmet.sourceforge.net
it looks alike to the previous post, but it does something completely different??
wazzup![]()
This traversal visits several trees, INDEX carries on its value throughout a chain of trees ; idem min, max.Can you remove ++index and put it into function call ... toFile(.... index++)?
Of course, I'm guessing.
//split a long string into substrings
// use of break and continue
unsigned short nSubStrings {8};
string* ayrFx = new string[nSubStrings + 1];
string line;
line = " USD PEN MXN BRL ARS CLP COP EUR";
unsigned short j {0}, i{0};
for (; i < line.length(); i++) {
//cout << line[i] << " ";
if (line[i] == ' ') continue;
while(line[i]) {
ayrFx[j] += line[i];
i++;
if (line[i] == ' ') break;
}
j++;
}
for (j = 1; j <= nSubStrings; j++) {
cout << "\n\tj:" << j << " " << ayrFx[j];
}
OUTPUT:
j:1 USD
j:2 PEN
j:3 MXN
j:4 BRL
j:5 ARS
j:6 CLP
j:7 COP
j:8 EU