compile error in vector.cpp (255)

compile error in vector.cpp (255)

Postby nuclph » Sat Nov 08, 2008 4:56 pm

Hello,



I have small question with respect to Vector.cpp file.

I am getting compile error such as:



vector.cpp(255) : error C2059: syntax error : ')'



this line looks like:





template <class V, class I, class S>

Vector<V, I, S>& Vector<V, I, S>:perator += (const Vector<V, I, S>& v)

{ // Add the elements





for (I i=MinIndex(); i<=MaxIndex(); i++)

(*this) = (*this) + v); // 255 line



return *this;

}



I am using Visual Studio 2008 to compile files.

Below, Vector.hpp and Vector.cpp versions which I have from Financial Instrument Pricing Using C++.

For some reasons, compiler does not understand this line.



Thank you in advance for the reply.



nuclph
Attachments
Vector.hpp
(3.59 KiB) Downloaded 711 times
Vector.cpp
(8.47 KiB) Downloaded 690 times
nuclph
 
Posts: 5
Joined: Fri Nov 07, 2008 11:39 pm

Postby Cuchulainn » Sun Mar 22, 2009 8:52 pm

In NumericMatrix the member function Element() was coded incorrectly. I use (,) operator overloading.



Here is the new source. Hope it helps.
Attachments
NumericMatrix.hpp
(1.89 KiB) Downloaded 731 times
numericmatrix.cpp
(6.25 KiB) Downloaded 754 times
User avatar
Cuchulainn
 
Posts: 669
Joined: Mon Dec 18, 2006 2:48 pm
Location: Amsterdam, the Netherlands

Postby admin » Thu Jan 28, 2010 9:21 am

array and matrix classes
Attachments
Array.cpp
(2.69 KiB) Downloaded 571 times
Array.hpp
(1.47 KiB) Downloaded 579 times
Matrix.hpp
(1.9 KiB) Downloaded 555 times
Matrix.cpp
(3.85 KiB) Downloaded 546 times
admin
Site Admin
 
Posts: 237
Joined: Thu Dec 07, 2006 4:03 pm
Location: Amsterdam, The Netherlands


Return to Financial Instrument Pricing using C++ (Duffy)

Who is online

Users browsing this forum: No registered users and 1 guest

cron