Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87865633
vec2ext.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Oct 15, 10:59
Size
802 B
Mime Type
text/x-c
Expires
Thu, Oct 17, 10:59 (2 d)
Engine
blob
Format
Raw Data
Handle
21670494
Attached To
rSTICAZZI yearII_reports
vec2ext.h
View Options
#pragma once
#ifndef __VEC2EXT_H__
#define __VEC2EXT_H__
#define _USE_VECTOR_OSTREAM
#include "symbasic/svector.h"
#include <istream>
// two dimensional vector definition
typedef SVector<double, 2> Vec2D;
/*
* Allows to load any kind of bi-dimensional vectors
* using the form (x, y)
*
* Example: (2, 3)
*
* for SVector declaration, take a look to "symbasic/svector.h"
*/
template<class T>
std::istream& operator>>(std::istream& is, SVector<T, 2>& v)
{
/*char delim;
is >> std::skipws;
is >> delim;
if (delim != '(')
throw '(';
is >> v[0];
is >> delim;
if (delim != ',')
throw ',';
is >> v[1];
is >> delim;
if (delim != ')')
throw ')';*/
return regex::parse(is, regex::term::round, v[0], v[1]);
}
#endif
Event Timeline
Log In to Comment