DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// // Copyright (c) 2000-2002 // Joerg Walter, Mathias Koch // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // The authors gratefully acknowledge the support of // GeNeSys mbH & Co. KG in producing this work. // #ifndef _BOOST_UBLAS_IO_ #define _BOOST_UBLAS_IO_ // Only forward definition required to define stream operations #include
#include
#include
namespace boost { namespace numeric { namespace ublas { template
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it. std::basic_ostream
&operator << (std::basic_ostream
&os, const vector_expression
&v) { typedef typename VE::size_type size_type; size_type size = v ().size (); std::basic_ostringstream
> s; s.flags (os.flags ()); s.imbue (os.getloc ()); s.precision (os.precision ()); s << '[' << size << "]("; if (size > 0) s << v () (0); for (size_type i = 1; i < size; ++ i) s << ',' << v () (i); s << ')'; return os << s.str ().c_str (); } template
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it. std::basic_istream
&operator >> (std::basic_istream
&is, vector
&v) { typedef typename vector
::size_type size_type; E ch; size_type size; if (is >> ch && ch != '[') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (is >> size >> ch && ch != ']') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { vector
s (size); if (is >> ch && ch != '(') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { for (size_type i = 0; i < size; i ++) { if (is >> s (i) >> ch && ch != ',') { is.putback (ch); if (i < size - 1) is.setstate (std::ios_base::failbit); break; } } if (is >> ch && ch != ')') { is.putback (ch); is.setstate (std::ios_base::failbit); } } if (! is.fail ()) v.swap (s); } return is; } template
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it. std::basic_ostream
&operator << (std::basic_ostream
&os, const matrix_expression
&m) { typedef typename ME::size_type size_type; size_type size1 = m ().size1 (); size_type size2 = m ().size2 (); std::basic_ostringstream
> s; s.flags (os.flags ()); s.imbue (os.getloc ()); s.precision (os.precision ()); s << '[' << size1 << ',' << size2 << "]("; if (size1 > 0) { s << '(' ; if (size2 > 0) s << m () (0, 0); for (size_type j = 1; j < size2; ++ j) s << ',' << m () (0, j); s << ')'; } for (size_type i = 1; i < size1; ++ i) { s << ",(" ; if (size2 > 0) s << m () (i, 0); for (size_type j = 1; j < size2; ++ j) s << ',' << m () (i, j); s << ')'; } s << ')'; return os << s.str ().c_str (); } template
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it. std::basic_istream
&operator >> (std::basic_istream
&is, matrix
&m) { typedef typename matrix
::size_type size_type; E ch; size_type size1, size2; if (is >> ch && ch != '[') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (is >> size1 >> ch && ch != ',') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (is >> size2 >> ch && ch != ']') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { matrix
s (size1, size2); if (is >> ch && ch != '(') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { for (size_type i = 0; i < size1; i ++) { if (is >> ch && ch != '(') { is.putback (ch); is.setstate (std::ios_base::failbit); break; } for (size_type j = 0; j < size2; j ++) { if (is >> s (i, j) >> ch && ch != ',') { is.putback (ch); if (j < size2 - 1) { is.setstate (std::ios_base::failbit); break; } } } if (is >> ch && ch != ')') { is.putback (ch); is.setstate (std::ios_base::failbit); break; } if (is >> ch && ch != ',') { is.putback (ch); if (i < size1 - 1) { is.setstate (std::ios_base::failbit); break; } } } if (is >> ch && ch != ')') { is.putback (ch); is.setstate (std::ios_base::failbit); } } if (! is.fail ()) m.swap (s); } return is; } // Special input operator for symmetrix_matrix template
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it. std::basic_istream
&operator >> (std::basic_istream
&is, symmetric_matrix
&m) { typedef typename symmetric_matrix
::size_type size_type; E ch; size_type size1, size2; MT value; if (is >> ch && ch != '[') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (is >> size1 >> ch && ch != ',') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (is >> size2 >> ch && (size2 != size1 || ch != ']')) { // symmetric matrix must be square is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { symmetric_matrix
s (size1, size2); if (is >> ch && ch != '(') { is.putback (ch); is.setstate (std::ios_base::failbit); } else if (! is.fail ()) { for (size_type i = 0; i < size1; i ++) { if (is >> ch && ch != '(') { is.putback (ch); is.setstate (std::ios_base::failbit); break; } for (size_type j = 0; j < size2; j ++) { if (is >> value >> ch && ch != ',') { is.putback (ch); if (j < size2 - 1) { is.setstate (std::ios_base::failbit); break; } } if (i <= j) { // this is the first time we read this element - set the value s(i,j) = value; } else if ( s(i,j) != value ) { // matrix is not symmetric is.setstate (std::ios_base::failbit); break; } } if (is >> ch && ch != ')') { is.putback (ch); is.setstate (std::ios_base::failbit); break; } if (is >> ch && ch != ',') { is.putback (ch); if (i < size1 - 1) { is.setstate (std::ios_base::failbit); break; } } } if (is >> ch && ch != ')') { is.putback (ch); is.setstate (std::ios_base::failbit); } } if (! is.fail ()) m.swap (s); } return is; } }}} #endif
io.hpp
Page URL
File URL
Prev
8/26
Next
Download
( 9 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.