Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

vec3.h File Reference

#include <vector>
#include <cmath>
#include <iostream>

Include dependency graph for vec3.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  EMAN

Classes

class  EMAN::Vec3< Type >
 The Vec3 object is a templated object, intended to instantiated with basic types such as int, float, double etc. More...
class  EMAN::Vec2< Type >
 The Vec2 is precisely the same as Vec3 except it works exclusively in 2D Note there are convenient typedef so one needn't bother about using template terminology typedef Vec2<float> Vec2f; typedef Vec2<int> Vec2i; typedef Vec2double> Vec2d; // Not recommended for use unless precision is addressed in this class. More...

Defines

#define eman__vec3_h__   1
 
Id
vec3.h,v 1.29 2010/03/11 22:45:32 gtang Exp


Typedefs

typedef Vec3< float > Vec3f
typedef Vec3< int > Vec3i
typedef Vec3< double > Vec3d
typedef Vec2< float > Vec2f
typedef Vec2< int > Vec2i
typedef Vec2< double > Vec2d

Functions

template<typename Type, typename Type2>
Vec3< Type > operator+ (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type > operator+ (const Vec3< Type > &v, const Type2 &n)
template<typename Type, typename Type2>
Vec3< Type > operator- (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type > operator- (const Vec3< Type > &v, const Type2 &n)
template<typename Type>
Vec3< Type > operator- (const Vec3< Type > &v)
template<typename Type, typename Type2>
Type operator * (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type2 > operator * (const Type &d, const Vec3< Type2 > &v)
template<typename Type, typename Type2>
Vec3< Type > operator * (const Vec3< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
Vec3< Type2 > operator/ (const Type &d, const Vec3< Type2 > &v)
template<typename Type, typename Type2>
Vec3< Type > operator/ (const Vec3< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
bool operator== (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
bool operator!= (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator+ (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator+ (const Vec2< Type > &v, const Type2 &n)
template<typename Type, typename Type2>
Vec2< Type > operator- (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator- (const Vec2< Type > &v, const Type2 &n)
template<typename Type>
Vec2< Type > operator- (const Vec2< Type > &v)
template<typename Type, typename Type2>
Type operator * (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type2 > operator * (const Type &d, const Vec2< Type2 > &v)
template<typename Type, typename Type2>
Vec2< Type > operator * (const Vec2< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
Vec2< Type2 > operator/ (const Type &d, const Vec2< Type2 > &v)
template<typename Type, typename Type2>
Vec2< Type > operator/ (const Vec2< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
bool operator== (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
bool operator!= (const Vec2< Type > &v1, const Vec2< Type2 > &v2)


Define Documentation

#define eman__vec3_h__   1
 

Id
vec3.h,v 1.29 2010/03/11 22:45:32 gtang Exp

Definition at line 37 of file vec3.h.


Typedef Documentation

typedef Vec2<double> EMAN::Vec2d
 

Definition at line 868 of file vec3.h.

typedef Vec2<float> EMAN::Vec2f
 

Definition at line 866 of file vec3.h.

Referenced by EMAN::RTFExhaustiveAligner::align(), EMAN::Transform::get_pre_trans_2d(), EMAN::Transform::get_trans_2d(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::operator *(), EMAN::padfft_slice(), EMAN::Util::point_is_in_convex_polygon_2d(), EMAN::Util::point_is_in_triangle_2d(), EMAN::BackProjectionReconstructor::preprocess_slice(), EMAN::StandardProjector::project3d(), EMAN::Transform3D::set_posttrans(), EMAN::Transform3D::set_pretrans(), EMAN::Transform::set_trans(), EMAN::Transform::transform(), and EMAN::TransformProcessor::transform().

typedef Vec2<int> EMAN::Vec2i
 

Definition at line 867 of file vec3.h.

typedef Vec3<double> EMAN::Vec3d
 

Definition at line 490 of file vec3.h.

Referenced by EMAN::EMUtil::process_region_io().

typedef Vec3<float> EMAN::Vec3f
 

Definition at line 488 of file vec3.h.

Referenced by ali3d_d(), EMAN::TranslationalAligner::align(), EMAN::PointArray::align_2d(), EMAN::PointArray::align_trans_2d(), EMAN::PawelProjector::backproject3d(), EMAN::Util::calc_bilinear_least_square(), EMAN::EMData::cut_slice(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::do_insert_slice_work(), EMAN::Util::KaiserBessel::dump_table(), EMAN::Util::equation_of_plane(), EMAN::EMData::extract_plane(), EMAN::EMData::extract_plane_rect(), EMAN::EMData::extract_plane_rect_fast(), EMAN::TetrahedralSym::get_asym_unit_points(), EMAN::PlatonicSym::get_asym_unit_points(), EMAN::HSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_points(), EMAN::CSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_triangles(), EMAN::CSym::get_asym_unit_triangles(), EMAN::Transform3D::get_center(), EMAN::BoxingTools::get_color(), EMAN::Transform3D::get_finger(), EMAN::Transform::get_hflip_transform(), EMAN::Transform3D::get_matrix3_col(), EMAN::Transform::get_matrix3_row(), EMAN::Transform3D::get_matrix3_row(), EMAN::Transform::get_params(), EMAN::Transform::get_params_inverse(), EMAN::Transform3D::get_posttrans(), EMAN::Transform::get_pre_trans(), EMAN::Transform3D::get_pretrans(), EMAN::EMData::get_rotated_clip(), EMAN::Transform3D::get_total_posttrans(), EMAN::Transform3D::get_total_pretrans(), EMAN::Symmetry3D::get_touching_au_transforms(), EMAN::Transform::get_trans(), EMAN::PointArray::get_vector_at(), EMAN::Transform::get_vflip_transform(), EMAN::Symmetry3D::in_which_asym_unit(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::TestTomoImage::insert_rectangle(), EMAN::Transform3D::inverse(), EMAN::Transform3D::inverseUsingAngs(), EMAN::EMData::max_3D_pixel_error(), EMAN::operator *(), EMAN::OptimumOrientationGenerator::optimize_distances(), EMAN::Symmetry3D::point_in_which_asym_unit(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::AutoMaskAsymUnit::process_inplace(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), EMAN::GaussFFTProjector::project3d(), EMAN::Quaternion::Quaternion(), EMAN::PointArray::replace_by_summation(), EMAN::PointArray::right_transform(), EMAN::PDBReader::right_transform(), EMAN::EMData::rot_scale_trans(), EMAN::EMData::rot_scale_trans_background(), EMAN::Transform3D::rotate(), EMAN::Quaternion::rotate(), EMAN::EMData::rotate_translate(), EMAN::Transform3D::set_center(), EMAN::PointArray::set_from(), EMAN::Transform3D::set_posttrans(), EMAN::Transform3D::set_pretrans(), EMAN::Transform3D::set_rotation(), EMAN::Transform::set_rotation(), EMAN::Transform::set_trans(), set_translation(), EMAN::PointArray::set_vector_at(), EMAN::MarchingCubes::surface_face_z(), EMAN::TestUtil::test_Vec3f(), EMAN::Quaternion::to_angle(), EMAN::Quaternion::to_axis(), EMAN::Transform3D::to_identity(), EMAN::Transform::transform(), EMAN::Transform3D::transform(), EMAN::TransformProcessor::transform(), EMAN::PointArray::transform(), EMAN::Transform3D::Transform3D(), EMAN::EMData::translate(), EMAN::EMData::uncut_slice(), EMAN::Quaternion::unreal(), and verify().

typedef Vec3<int> EMAN::Vec3i
 

Definition at line 489 of file vec3.h.

Referenced by ali3d_d(), AlignOptions::AlignOptions(), EMAN::PawelProjector::backproject3d(), EMAN::ChaoProjector::backproject3d(), EMAN::ChaoProjector::bckpj3(), bckpj3(), bckpj3_Cart(), EMAN::ChaoProjector::cb2sph(), cb2sph(), CleanStack(), CleanStack_Cart(), fcalc(), fgcalc(), EMAN::WatershedProcessor::find_region(), find_region(), EMAN::ChaoProjector::fwdpj3(), fwdpj3(), fwdpj3_Cart(), EMAN::EMUtil::get_region_dims(), getcb2sph(), EMAN::ChaoProjector::getnnz(), getnnz(), LBD_Cart(), main(), EMAN::EMData::mask_contig_region(), EMAN::PawelProjector::prepcubes(), EMAN::WatershedProcessor::process_inplace(), EMAN::EMUtil::process_region_io(), EMAN::ChaoProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), recons3d_CGLS_mpi_Cart(), recons3d_HyBR_mpi_Cart(), recons3d_sirt_mpi(), recons3d_sirt_mpi_Cart(), EMAN::ChaoProjector::sph2cb(), sph2cb(), EMAN::TestUtil::test_Vec3i(), EMAN::EMData::translate(), unified(), and EMAN::WatershedProcessor::watershed().


Function Documentation

template<typename Type, typename Type2>
Vec2<Type> operator * const Vec2< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 826 of file vec3.h.

References v.

00826                                                                           {
00827         // Preserve the vector type
00828                 Vec2<Type> v1(v);
00829                 v1 *= d;
00830                 return v1;
00831         }

template<typename Type, typename Type2>
Vec2<Type2> operator * const Type &  d,
const Vec2< Type2 > &  v
[inline]
 

Definition at line 817 of file vec3.h.

References v.

00818         {
00819                 // Preserve the vector type
00820                 Vec2<Type2> v1(v);
00821                 v1 *= d;
00822                 return v1;
00823         }

template<typename Type, typename Type2>
Type operator * const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 811 of file vec3.h.

References EMAN::Vec2< Type >::dot().

00812         {
00813                 return v1.dot(v2);
00814         }

template<typename Type, typename Type2>
Vec3<Type> operator * const Vec3< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 448 of file vec3.h.

References v.

00448                                                                           {
00449                 // Preserve the vector type
00450                 Vec3<Type> v1(v);
00451                 v1 *= d;
00452                 return v1;
00453         }

template<typename Type, typename Type2>
Vec3<Type2> operator * const Type &  d,
const Vec3< Type2 > &  v
[inline]
 

Definition at line 439 of file vec3.h.

References v.

00440         {
00441                 // Preserve the vector type
00442                 Vec3<Type2> v1(v);
00443                 v1 *= d;
00444                 return v1;
00445         }

template<typename Type, typename Type2>
Type operator * const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 433 of file vec3.h.

References EMAN::Vec3< Type >::dot().

00434         {
00435                 return v1.dot(v2);
00436         }

template<typename Type, typename Type2>
bool operator!= const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 859 of file vec3.h.

00859                                                                              {
00860                 if (v1[0] != v2[0] || v1[1] != v2[1] ) {
00861                         return true;
00862                 }
00863                 return false;
00864         }

template<typename Type, typename Type2>
bool operator!= const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 481 of file vec3.h.

00481                                                                              {
00482                 if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) {
00483                         return true;
00484                 }
00485                 return false;
00486         }

template<typename Type, typename Type2>
Vec2<Type> operator+ const Vec2< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 782 of file vec3.h.

References v.

00783         {
00784                 Vec2<Type> v1(v);
00785                 v1 += n;
00786                 return v1;
00787         }

template<typename Type, typename Type2>
Vec2<Type> operator+ const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 776 of file vec3.h.

00777         {
00778                 return Vec2<Type>(static_cast<Type>(v1[0] + v2[0]), static_cast<Type>(v1[1] + v2[1]));;
00779         }

template<typename Type, typename Type2>
Vec3<Type> operator+ const Vec3< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 388 of file vec3.h.

References v.

00389         {
00390                 Vec3<Type> v1(v);
00391                 v1 += n;
00392                 return v1;
00393         }

template<typename Type, typename Type2>
Vec3<Type> operator+ const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 381 of file vec3.h.

00382         {
00383 
00384                 return Vec3<Type>(static_cast<Type>(v1[0] + v2[0]), static_cast<Type>(v1[1] + v2[1]),static_cast<Type>(v1[2] + v2[2]));;
00385         }

template<typename Type>
Vec2<Type> operator- const Vec2< Type > &  v  )  [inline]
 

Definition at line 804 of file vec3.h.

References v.

00805         {
00806                 return Vec2<Type>(-v[0],-v[1]);
00807         }

template<typename Type, typename Type2>
Vec2<Type> operator- const Vec2< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 796 of file vec3.h.

References v.

00797         {
00798                 Vec2<Type> v1(v);
00799                 v1 -= n;
00800                 return v1;
00801         }

template<typename Type, typename Type2>
Vec2<Type> operator- const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 790 of file vec3.h.

00791         {
00792                 return Vec2<Type>(static_cast<Type>(v1[0] - v2[0]),     static_cast<Type>(v1[1] - v2[1]));
00793         }

template<typename Type>
Vec3<Type> operator- const Vec3< Type > &  v  )  [inline]
 

Definition at line 419 of file vec3.h.

References v.

00420         {
00421                 return Vec3<Type>(-v[0],-v[1],-v[2]);
00422         }

template<typename Type, typename Type2>
Vec3<Type> operator- const Vec3< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 412 of file vec3.h.

References v.

00413         {
00414                 Vec3<Type> v1(v);
00415                 v1 -= n;
00416                 return v1;
00417         }

template<typename Type, typename Type2>
Vec3<Type> operator- const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 404 of file vec3.h.

00405         {
00406                 return Vec3<Type>(static_cast<Type>(v1[0] - v2[0]),
00407                                                   static_cast<Type>(v1[1] - v2[1]),
00408                                                   static_cast<Type>(v1[2] - v2[2]));
00409         }

template<typename Type, typename Type2>
Vec2<Type> operator/ const Vec2< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 843 of file vec3.h.

References v.

00843                                                                           {
00844                 // Preserve the vector type
00845                 Vec2<Type> v1(v);
00846                 v1 /= d;
00847                 return v1;
00848         }

template<typename Type, typename Type2>
Vec2<Type2> operator/ const Type &  d,
const Vec2< Type2 > &  v
[inline]
 

Definition at line 834 of file vec3.h.

References v.

00835         {
00836         // Preserve the vector type
00837                 Vec2<Type2> v1(v);
00838                 v1 /= d;
00839                 return v1;
00840         }

template<typename Type, typename Type2>
Vec3<Type> operator/ const Vec3< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 465 of file vec3.h.

References v.

00465                                                                           {
00466                 // Preserve the vector type
00467                 Vec3<Type> v1(v);
00468                 v1 /= d;
00469                 return v1;
00470         }

template<typename Type, typename Type2>
Vec3<Type2> operator/ const Type &  d,
const Vec3< Type2 > &  v
[inline]
 

Definition at line 456 of file vec3.h.

References v.

00457         {
00458                 // Preserve the vector type
00459                 Vec3<Type2> v1(v);
00460                 v1 /= d;
00461                 return v1;
00462         }

template<typename Type, typename Type2>
bool operator== const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 851 of file vec3.h.

00851                                                                              {
00852                 if (v1[0] == v2[0] && v1[1] == v2[1] ) {
00853                         return true;
00854                 }
00855                 return false;
00856         }

template<typename Type, typename Type2>
bool operator== const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 473 of file vec3.h.

00473                                                                              {
00474                 if (v1[0] == v2[0] && v1[1] == v2[1] && v1[2] == v2[2]) {
00475                         return true;
00476                 }
00477                 return false;
00478         }


Generated on Thu Dec 9 13:47:01 2010 for EMAN2 by  doxygen 1.3.9.1