[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] gvars3 gvars3/gv3_implementation.hh gvars3/gvar...
From: |
Edward Rosten |
Subject: |
[libcvd-members] gvars3 gvars3/gv3_implementation.hh gvars3/gvar... |
Date: |
Mon, 20 Apr 2009 13:31:21 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: gvars3
Changes by: Edward Rosten <edrosten> 09/04/20 13:31:21
Modified files:
gvars3 : gv3_implementation.hh gvars3.h
src : gvars2.cc serialize.cc
Log message:
Fixed optional TooN
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gvars3/gvars3/gv3_implementation.hh?cvsroot=libcvd&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gvars3/gvars3/gvars3.h?cvsroot=libcvd&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gvars3/src/gvars2.cc?cvsroot=libcvd&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gvars3/src/serialize.cc?cvsroot=libcvd&r1=1.11&r2=1.12
Patches:
Index: gvars3/gv3_implementation.hh
===================================================================
RCS file: /cvsroot/libcvd/gvars3/gvars3/gv3_implementation.hh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gvars3/gv3_implementation.hh 20 Apr 2009 12:59:20 -0000 1.11
+++ gvars3/gv3_implementation.hh 20 Apr 2009 13:31:21 -0000 1.12
@@ -7,12 +7,12 @@
#ifdef GVARS3_HAVE_TOON
// Replacement for operator= which doesn't crash for Vector<-1>; specialisation
-/*void inline robust_assignment(TooN::Vector<> &lvalue, TooN::Vector<> rhs)
+void inline robust_assignment(TooN::Vector<> &lvalue, TooN::Vector<> rhs)
{
if(lvalue.size()!=rhs.size())
lvalue.resize(rhs.size());
lvalue = rhs;
-}*/
+}
#endif
// TODO: Make the specialisation for matrices as well.
Index: gvars3/gvars3.h
===================================================================
RCS file: /cvsroot/libcvd/gvars3/gvars3/gvars3.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gvars3/gvars3.h 20 Apr 2009 12:59:20 -0000 1.20
+++ gvars3/gvars3.h 20 Apr 2009 13:31:21 -0000 1.21
@@ -302,14 +302,17 @@
int& GetInt(const std::string& name, int default_val=0, int
flags=0);
double& GetDouble(const std::string& name, double
default_val=0.0, int flags=0);
std::string& GetString(const std::string& name, const
std::string& default_val="", int flags=0);
- //TooN::Vector<>& GetVector(const std::string& name, const
TooN::Vector<>& default_val=TooN::Vector<>(), int flags=0);
- //TooN::Matrix<>& GetMatrix(const std::string& name, const
TooN::Matrix<>& default_val=TooN::Matrix<>(), int flags=0);
+
+ #ifdef GVARS3_HAVE_TOON
+ TooN::Vector<>& GetVector(const std::string& name,
const TooN::Vector<>& default_val=TooN::Vector<>(), int flags=0);
+ TooN::Matrix<>& GetMatrix(const std::string& name,
const TooN::Matrix<>& default_val=TooN::Matrix<>(), int flags=0);
+ TooN::Vector<>& GetVector(const std::string& name,
const std::string& default_val, int flags=0);
+ TooN::Matrix<>& GetMatrix(const std::string& name,
const std::string& default_val, int flags=0);
+ #endif
int& GetInt(const std::string& name, const std::string&
default_val, int flags=0);
double& GetDouble(const std::string& name, const std::string&
default_val, int flags=0);
- //TooN::Vector<>& GetVector(const std::string& name, const
std::string& default_val, int flags=0);
- //TooN::Matrix<>& GetMatrix(const std::string& name, const
std::string& default_val, int flags=0);
std::string StringValue(const std::string &name, bool
no_quotes=false);
void PrintVarList(std::ostream& os=std::cout);
Index: src/gvars2.cc
===================================================================
RCS file: /cvsroot/libcvd/gvars3/src/gvars2.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- src/gvars2.cc 20 Apr 2009 12:59:20 -0000 1.7
+++ src/gvars2.cc 20 Apr 2009 13:31:21 -0000 1.8
@@ -65,14 +65,14 @@
}
#ifdef GVARS3_HAVE_TOON
- Vector<>& GVars2::GetVector(const string& name, const Vector<>&
default_val, int flags)
+ TooN::Vector<>& GVars2::GetVector(const string& name, const
TooN::Vector<>& default_val, int flags)
{
- return Get<Vector<> >(name, default_val, flags);
+ return Get<TooN::Vector<> >(name, default_val, flags);
}
- Matrix<>& GVars2::GetMatrix(const string& name, const Matrix<>&
default_val, int flags)
+ TooN::Matrix<>& GVars2::GetMatrix(const string& name, const
TooN::Matrix<>& default_val, int flags)
{
- return Get<Matrix<> >(name, default_val, flags);
+ return Get<TooN::Matrix<> >(name, default_val, flags);
}
#endif
@@ -89,14 +89,14 @@
}
#ifdef GVARS3_HAVE_TOON
- Vector<>& GVars2::GetVector(const string& name, const string&
default_val, int flags)
+ TooN::Vector<>& GVars2::GetVector(const string& name, const string&
default_val, int flags)
{
- return Get<Vector<> >(name, default_val, flags);
+ return Get<TooN::Vector<> >(name, default_val, flags);
}
- Matrix<>& GVars2::GetMatrix(const string& name, const string&
default_val, int flags)
+ TooN::Matrix<>& GVars2::GetMatrix(const string& name, const string&
default_val, int flags)
{
- return Get<Matrix<> >(name, default_val, flags);
+ return Get<TooN::Matrix<> >(name, default_val, flags);
}
#endif
Index: src/serialize.cc
===================================================================
RCS file: /cvsroot/libcvd/gvars3/src/serialize.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/serialize.cc 20 Apr 2009 12:59:20 -0000 1.11
+++ src/serialize.cc 20 Apr 2009 13:31:21 -0000 1.12
@@ -34,6 +34,26 @@
return s;
}
+ istream& get_string(istream& in, string& s)
+ {
+ s.clear();
+
+ bool quoted=0;
+ int c;
+
+ //Eat whitespace
+ in >> ws;
+
+ if((c=in.get()) == EOF)
+ return in;
+
+ if(c == '"')
+ quoted=1;
+
+
+
+ }
+
// For reading strings, if there's double quotes, lift the part inside
the double quotes.
int from_string(std::string s, std::string& so) //Pretty ugly code
lifted from GVars2, but works.
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] gvars3 gvars3/gv3_implementation.hh gvars3/gvar...,
Edward Rosten <=