, . , , , . , . .. :
for( size_t i=0; i < myvec.size(); ++i )
{
myvec[i] = 10.0;
}
myvec[0] = myvec[1] = myvec[2] = 10.0;
3d- , ip- .. std::vector, () , . , , , , . , , , .
PS: Valgrind is your friend to tell you where to optimize first. Indeed, the size operator often appears as the main candidate; at least for some algorithms.
Good luck
source
share