Update of /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv709/ohxl/Conversions
Modified Files:
matrixtooper.hpp opertomatrix.hpp validations.cpp
vectortooper.hpp
Log Message:
use pre-increment where appropriate
Index: vectortooper.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/vectortooper.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vectortooper.hpp 19 Nov 2006 13:08:27 -0000 1.2
--- vectortooper.hpp 3 Jan 2007 14:24:30 -0000 1.3
***************
*** 44,48 ****
throw Exception("vectorToOper: error on call to new");
xVector.xltype = xltypeMulti | xlbitDLLFree;
! for (unsigned int i=0; i<v.size(); i++)
scalarToOper(xVector.val.array.lparray[i], v[i]);
}
--- 44,48 ----
throw Exception("vectorToOper: error on call to new");
xVector.xltype = xltypeMulti | xlbitDLLFree;
! for (unsigned int i=0; i<v.size(); ++i)
scalarToOper(xVector.val.array.lparray[i], v[i]);
}
Index: opertomatrix.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/opertomatrix.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** opertomatrix.hpp 2 Jan 2007 15:11:53 -0000 1.4
--- opertomatrix.hpp 3 Jan 2007 14:24:30 -0000 1.5
***************
*** 46,53 ****
ret.reserve(xMulti->val.array.rows);
! for (int i=0; i<xMulti->val.array.rows; i++) {
std::vector<T> row;
row.reserve(xMulti->val.array.columns);
! for (int j=0; j<xMulti->val.array.columns; j++) {
T value;
operToScalar(value, xMulti->val.array.lparray[i * xMulti->val.array.columns + j]);
--- 46,53 ----
ret.reserve(xMulti->val.array.rows);
! for (int i=0; i<xMulti->val.array.rows; ++i) {
std::vector<T> row;
row.reserve(xMulti->val.array.columns);
! for (int j=0; j<xMulti->val.array.columns; ++j) {
T value;
operToScalar(value, xMulti->val.array.lparray[i * xMulti->val.array.columns + j]);
***************
*** 74,81 ****
std::vector<std::vector<T> > ret;
ret.reserve(fpMatrix.rows);
! for (int i=0; i<fpMatrix.rows; i++) {
std::vector<T> row;
row.reserve(fpMatrix.columns);
! for (int j=0; j<fpMatrix.columns; j++)
row.push_back(fpMatrix.array[i * fpMatrix.columns + j]);
ret.push_back(row);
--- 74,81 ----
std::vector<std::vector<T> > ret;
ret.reserve(fpMatrix.rows);
! for (int i=0; i<fpMatrix.rows; ++i) {
std::vector<T> row;
row.reserve(fpMatrix.columns);
! for (int j=0; j<fpMatrix.columns; ++j)
row.push_back(fpMatrix.array[i * fpMatrix.columns + j]);
ret.push_back(row);
Index: validations.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/validations.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** validations.cpp 8 Dec 2006 14:46:12 -0000 1.3
--- validations.cpp 3 Jan 2007 14:24:30 -0000 1.4
***************
*** 24,28 ****
bool validateMulti(const OPER *xMulti) {
! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; i++)
if (xMulti->val.array.lparray[i].xltype == xltypeErr)
return false;
--- 24,28 ----
bool validateMulti(const OPER *xMulti) {
! for (int i=0; i<xMulti->val.array.rows * xMulti->val.array.columns; ++i)
if (xMulti->val.array.lparray[i].xltype == xltypeErr)
return false;
Index: matrixtooper.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/Conversions/matrixtooper.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** matrixtooper.hpp 19 Nov 2006 13:08:27 -0000 1.2
--- matrixtooper.hpp 3 Jan 2007 14:24:30 -0000 1.3
***************
*** 37,43 ****
throw Exception("matrixToOper: error on call to new");
xMatrix.xltype = xltypeMulti | xlbitDLLFree;
! for (unsigned int i=0; i<vv.size(); i++) {
std::vector<T> v = vv[i];
! for (unsigned int j=0; j<v.size(); j++)
scalarToOper(xMatrix.val.array.lparray[i * v.size() + j], v[j]);
}
--- 37,43 ----
throw Exception("matrixToOper: error on call to new");
xMatrix.xltype = xltypeMulti | xlbitDLLFree;
! for (unsigned int i=0; i<vv.size(); ++i) {
std::vector<T> v = vv[i];
! for (unsigned int j=0; j<v.size(); ++j)
scalarToOper(xMatrix.val.array.lparray[i * v.size() + j], v[j]);
}
|