Easy3D 2.6.1
Loading...
Searching...
No Matches
easy3d Namespace Reference

Namespaces

namespace  buffer
 Functions for updating render buffers.
 
namespace  curve
 Algorithms for evaluating curves.
 
namespace  file_system
 A very basic filesystem implementation.
 
namespace  geom
 Functions for basic geometric computations.
 
namespace  io
 File input/output functionalities.
 
namespace  logging
 The logging mechanism.
 
namespace  opengl
 OpenGL-related functionalities for reading pixel/depth data from the framebuffer.
 
namespace  resource
 Resources used in Easy3D.
 
namespace  setting
 Default parameters used for initializing rendering and UI.
 
namespace  shape
 A collection of functions for rendering basic shapes.
 
namespace  string
 String manipulation utilities.
 
namespace  transform
 Functions that generate common transformation matrices (all using the right-handed coordinate system).
 

Classes

class  AmbientOcclusion
 Traditional Screen Space Ambient Occlusion (SSAO) technique. More...
 
class  AverageColorBlending
 Transparency effect using average color blending. More...
 
class  AxisPlaneConstraint
 An abstract class for Frame Constraints defined by an axis or a plane. More...
 
class  BasePropertyArray
 Base class for a property array. More...
 
class  Bezier
 Class for Bezier curve fitting. More...
 
class  BSpline
 Class for BSpline curve fitting. More...
 
class  Camera
 A perspective or orthographic camera. More...
 
class  CameraConstraint
 An AxisPlaneConstraint defined in the camera coordinate system. More...
 
class  CatmullRom
 Class for CatmullRom curve interpolation. More...
 
class  ClippingPlane
 An implementation of a manipulable clipping plane for visualization of model interiors and cross sections. More...
 
class  Collider
 Efficient collision detection. More...
 
class  Constraint
 An interface class for Frame constraints. More...
 
class  Curve
 Abstract base class for curve fitting/interpolation. More...
 
class  Delaunay
 Base class for Delaunay triangulation. More...
 
class  Delaunay2
 2D Delaunay triangulation, using Jonathan Richard Shewchuk's "triangle" implementation. More...
 
class  Delaunay3
 3D Delaunay triangulation, using Hang Si's tetgen. More...
 
class  Drawable
 The base class for drawable objects. A drawable represent a set of points, line segments, or triangles. More...
 
class  DualDepthPeeling
 Transparency effect using dual depth peeling. More...
 
class  EigenSolver
 An easy-to-use eigen solver. More...
 
class  EyeDomeLighting
 An implementation of the Eye Dome Lighting (EDL) technique. More...
 
class  Frame
 The Frame class represents a coordinate system, defined by a position and an orientation. More...
 
class  FramebufferObject
 An implementation of framebuffer object (FBO). More...
 
class  Frustum
 A Frustum description for perspective projection. More...
 
class  GaussianNoise
 Add Gaussian noise to 3D models. More...
 
class  GenericBox
 GenericBox represents the bounding box of shapes. More...
 
class  GenericLine
 A generic line representation, which supports both 2D and 3D lines. More...
 
class  GenericOrientedLine
 OrientedLine implements plucker coordinates, which enables oriented lines to be compared. More...
 
class  GenericPlane
 A 3D Plane of equation a*x + b*y + c*z + d = 0. More...
 
class  GenericPolygon
 A 2D polygon representation. More...
 
class  GenericRect
 The GenericRect class defines a rectangle in the 2D space, where the origin of the coordinate system is located in the top-left corner of the screen. More...
 
class  GenericSegment
 A generic segmentation representation, which supports both 2D and 3D line segments. More...
 
class  Graph
 A Graph data structure with easy property management. More...
 
class  GraphIO
 Implementation of file input/output operations for Graph (Currently only PLY format is supported). More...
 
class  Heap
 A class implementing a heap. More...
 
class  ImageIO
 Implementation of file input/output operations for images. More...
 
class  KdTreeSearch
 Base class for nearest neighbor search using KdTree. More...
 
class  KdTreeSearch_ANN
 KdTree implementation based on ANN. More...
 
class  KdTreeSearch_ETH
 KdTree implementation based on Richard Keiser's KdTree code. More...
 
class  KdTreeSearch_FLANN
 KdTree implementation based on FLANN. More...
 
class  KdTreeSearch_NanoFLANN
 KdTree implementation based on NanoFLANN. More...
 
class  KeyFrameInterpolator
 A keyframe interpolator for animation generation. More...
 
class  LinesDrawable
 The drawable for rendering a set of line segments, e.g., edges of a mesh, vector fields. More...
 
class  LinesDrawable2D
 The drawable for rendering a set of line segments in the screen space. More...
 
class  LocalConstraint
 An AxisPlaneConstraint defined in the Frame local coordinate system. More...
 
class  ManipulatedCameraFrame
 A manipulated frame with camera-specific mouse bindings. More...
 
class  ManipulatedFrame
 A Frame that can be rotated and translated using the mouse. More...
 
class  Manipulator
 A manipulator is for manipulation of an object. More...
 
class  Mat
 Base class for matrix types. More...
 
class  Mat2
 2 by 2 matrix. Extends Mat with 2D-specific functionality and constructors. More...
 
class  Mat3
 3 by 3 matrix. Extends Mat with 3D-specific functionality and constructors. More...
 
class  Mat4
 4 by 4 matrix. Extends Mat with 4D-specific functionality and constructors. More...
 
class  Matrix
 A matrix representation, which supports dynamic sizes. More...
 
class  Model
 The base class of renderable 3D models. More...
 
class  ModelPicker
 Implementation of picking mechanism for set of models. More...
 
class  MultiViewer
 A viewer that supports multiple views (arranged in a grid layout). More...
 
class  OffScreen
 Offscreen rendering. More...
 
class  OpenGLTimer
 Accurate timing of GPU operations. More...
 
class  OpenglUtil
 Utilities for OpenGL initialization and states query. More...
 
class  OverlappingFaces
 Detects/Removes duplicate and folding faces for a triangle mesh. More...
 
class  Picker
 Base class for picking mechanism. More...
 
class  PointCloud
 A data structure for point clouds. More...
 
class  PointCloudIO
 Implementation of file input/output operations for PointCloud. More...
 
class  PointCloudNormals
 Estimates and reorients point cloud normals. More...
 
class  PointCloudPicker
 Implementation of picking points from a point cloud. More...
 
class  PointCloudSimplification
 PointCloudSimplification provides various point cloud simplification algorithms. More...
 
class  PointsDrawable
 The drawable for rendering a set of points, e.g., point clouds, vertices of a mesh. More...
 
class  PoissonReconstruction
 Poisson surface reconstruction. More...
 
class  PolygonPartition
 Convex partition of polygons. More...
 
class  PolyMesh
 Data structure representing a polyhedral mesh. More...
 
class  PolyMeshIO
 Implementation of file input/output operations for PolyMesh. More...
 
class  PrimitivesRansac
 Extract primitives from point clouds using RANSAC.Usage example: More...
 
class  PrincipalAxes
 Computes the principal axes for a set of 2D or 3D points. More...
 
class  ProgressClient
 The base class of GUI element reporting the progress. More...
 
class  ProgressLogger
 An implementation of progress logging mechanism. More...
 
class  Property
 Implementation of a generic property. More...
 
class  PropertyArray
 Implementation of a generic property array. More...
 
class  PropertyContainer
 Implementation of a generic property container. More...
 
class  Quat
 The Quaternion class represents 3D rotations and orientations. More...
 
class  Renderer
 A Renderer manages the drawables (and thus the rendering) of a model. More...
 
class  SelfIntersection
 Detects and resolves self-intersection for surface mesh. More...
 
class  ShaderManager
 Management of shader programs. More...
 
class  ShaderProgram
 OpenGL Shader Compilation. More...
 
class  Shadow
 Shadow implements the standard shadow map (hard shadow) algorithm. More...
 
class  Signal
 A light-weight implementation of the simple signal-slot mechanism. More...
 
class  SoftShadow
 An implementation of the Percentage-Closer Soft Shadows. More...
 
class  SplineCurveFitting
 Spline curve fitting for arbitrary dimensions. More...
 
class  SplineCurveInterpolation
 Cubic spline curve interpolation for arbitrary dimensions. More...
 
class  SplineInterpolation
 Cubic spline interpolation. More...
 
class  State
 Class representing the rendering state of a drawable. More...
 
class  StopWatch
 A high resolution stop watch/timer. More...
 
class  SurfaceMesh
 A halfedge data structure for polygonal meshes of 2-manifold. More...
 
class  SurfaceMeshBuilder
 A helper class for constructing manifold surface mesh models. More...
 
class  SurfaceMeshComponent
 A connected component of a SurfaceMesh. More...
 
class  SurfaceMeshCurvature
 Compute per-vertex curvatures, i.e., principle (min, max), mean, Gaussian. More...
 
class  SurfaceMeshEnumerator
 Enumerates connected components for a surface mesh. More...
 
class  SurfaceMeshFactory
 Factory class to generate different types of basic shapes. More...
 
class  SurfaceMeshFairing
 A class for implicitly fairing a surface mesh. More...
 
class  SurfaceMeshFeatures
 Detect and mark feature edges based on boundary or dihedral angle. More...
 
class  SurfaceMeshGeodesic
 This class computes geodesic distance from a set of seed vertices. More...
 
class  SurfaceMeshHoleFilling
 This class closes simple holes in a surface mesh. More...
 
class  SurfaceMeshIO
 Implementation of file input/output operations for SurfaceMesh. More...
 
class  SurfaceMeshParameterization
 A class for surface parameterization. More...
 
class  SurfaceMeshPicker
 Implementation of picking elements (i.e, vertices, faces, edges) from a surface mesh. More...
 
class  SurfaceMeshPolygonization
 Merge connected coplanar faces into a general polygon face. More...
 
class  SurfaceMeshRemeshing
 A class for uniform and adaptive surface remeshing. More...
 
class  SurfaceMeshSampler
 Sample a surface mesh (near uniformly) into a point cloud. More...
 
class  SurfaceMeshSimplification
 Surface mesh simplification based on approximation error and fairness criteria. More...
 
class  SurfaceMeshSmoothing
 A class for Laplacian smoothing. More...
 
class  SurfaceMeshStitching
 Stitch coincident border edges of a surface mesh. More...
 
class  SurfaceMeshSubdivision
 SurfaceMeshSubdivision implement several well-known subdivision algorithms. More...
 
class  SurfaceMeshTetrehedralization
 Generate quality tetrahedralization from closed shells. More...
 
class  SurfaceMeshTopology
 Compute various topological characteristics of a surface mesh component. More...
 
class  SurfaceMeshTriangulation
 Triangulate a polygonal mesh into a pure triangle mesh. More...
 
class  Surfacer
 A collection of mesh (and polygon soup) processing functions. More...
 
class  Tessellator
 Tessellator subdivides concave planar polygons, polygons with holes, or polygons with intersecting edges into triangles or simple contours. More...
 
class  TextMesher
 Generate a 3D surface mesh from a text string. More...
 
class  TextRenderer
 TextRenderer enables quick and easy string rendering in OpenGL applications. More...
 
class  Texture
 OpenGL texture. More...
 
class  TextureManager
 Management of OpenGL textures. More...
 
class  Timer
 A light-weight implementation of the timer mechanism. More...
 
class  Tokenizer
 A utility class for splitting strings into tokens based on delimiters. More...
 
class  Translator
 Manages the translation of all the models during the file IO. More...
 
class  Transparency
 Base class for rendering with transparency. More...
 
class  TriangleMeshKdTree
 A k-d tree for triangular surface meshes. More...
 
class  TrianglesDrawable
 The drawable for rendering a set of triangles, e.g., the surface of a triangular mesh. More...
 
class  Vec
 Base class for vector types. It provides generic functionality for N dimensional vectors. More...
 
class  Vec< 2, T >
 Specialization of Vec for 2D vectors (used for representing 2D points or vectors).
 
class  Vec< 3, T >
 Specialization of Vec for 3D vectors (used for representing 3D points or vectors, or RGB colors).
 
class  Vec< 4, T >
 Specialization of Vec for 4D vectors (used for representing 4D points or vectors in homogeneous coordinates, or RGBA colors).
 
class  VertexArrayObject
 A thin wrapper around an OpenGL Vertex Array Object (VAO). More...
 
class  VideoEncoder
 A class that encodes video frames (e.g., images) into a video file. More...
 
class  Viewer
 The built-in Easy3D viewer. More...
 
class  VoronoiCell3d
 A data structure for 3D Voronoi cells. More...
 
class  WorldConstraint
 An AxisPlaneConstraint defined in the world coordinate system. More...
 

Typedefs

using MATRIX = easy3d::Matrix<double>
 The matrix type used in this file.
 
typedef Vec< 2, float > vec2
 A 2D point/vector of float type.
 
typedef Vec< 3, float > vec3
 A 3D point/vector of float type.
 
typedef Vec< 4, float > vec4
 A 4D point/vector of float type.
 
typedef Vec< 2, double > dvec2
 A 2D point/vector of double type.
 
typedef Vec< 3, double > dvec3
 A 3D point/vector of double type.
 
typedef Vec< 4, double > dvec4
 A 4D point/vector of double type.
 
typedef Vec< 2, int32_t > ivec2
 A 2D point/vector of int32_t type.
 
typedef Vec< 3, int32_t > ivec3
 A 3D point/vector of int32_t type.
 
typedef Vec< 4, int32_t > ivec4
 A 4D point/vector of int32_t type.
 
typedef Mat2< float > mat2
 A 2 by 2 matrix of float type.
 
typedef Mat3< float > mat3
 A 3 by 3 matrix of float type.
 
typedef Mat4< float > mat4
 A 4 by 4 matrix of float type.
 
typedef Mat< 3, 4, float > mat34
 A 3 by 4 matrix of float type.
 
typedef Mat< 4, 3, float > mat43
 A 4 by 3 matrix of float type.
 
typedef Mat2< double > dmat2
 A 2 by 2 matrix of double type.
 
typedef Mat3< double > dmat3
 A 3 by 3 matrix of double type.
 
typedef Mat4< double > dmat4
 A 4 by 4 matrix of double type.
 
typedef Mat< 3, 4, double > dmat34
 A 3 by 4 matrix of double type.
 
typedef Mat< 4, 3, double > dmat43
 A 4 by 3 matrix of double type.
 
typedef Quat< float > quat
 A quaternion of float type.
 
typedef Quat< double > dquat
 A quaternion of double type.
 
typedef GenericLine< 2, float > Line2
 A 2D line of float type.
 
typedef GenericLine< 3, float > Line3
 A 3D line of float type.
 
typedef GenericOrientedLine< float > OrientedLine3
 A 3D oriented line of float type.
 
typedef GenericSegment< 2, float > Segment2
 A 2D line segment of float type.
 
typedef GenericSegment< 3, float > Segment3
 A 3D line segment of float type.
 
typedef GenericPlane< float > Plane3
 A 3D plane of float type.
 
typedef GenericBox< 2, float > Box2
 A 2D axis-aligned bounding box of float type.
 
typedef GenericBox< 3, float > Box3
 A 3D axis-aligned bounding box of float type.
 
typedef GenericRect< float > Rect
 A 2D axis-aligned rectangle of float type.
 
typedef GenericRect< int32_t > iRect
 A 2D axis-aligned rectangle of int32_t type.
 
typedef GenericPolygon< float > Polygon2
 A 2D polygon of float type.
 

Enumerations

enum  Sign { NEGATIVE = -1 , ZERO = 0 , POSITIVE = 1 }
 The sign.
 

Functions

bool extrude (SurfaceMesh *mesh, const std::vector< Polygon2 > &contours, float height)
 Extrudes a 3D surface mesh from a set of simple contours.
 
SurfaceMeshextrude (const std::vector< Polygon2 > &contours, float height)
 Extrudes a 3D surface mesh from a set of simple contours.
 
template<int DIM, typename FT>
bool has_nan (const GenericBox< DIM, FT > &box)
 Check if the representation of a box has NaN.
 
template<typename FT>
FT min ()
 Function returning minimum representable value for a given type.
 
template<typename FT>
FT max ()
 Function returning maximum representable value for a given type.
 
template<>
int min< int > ()
 Function returning min for int type numbers.
 
template<>
int max< int > ()
 Function returning max for int type numbers.
 
template<>
float min< float > ()
 Function returning min for float type numbers.
 
template<>
float max< float > ()
 Function returning max for float type numbers.
 
template<>
double min< double > ()
 Function returning min for double type numbers.
 
template<>
double max< double > ()
 Function returning max for double type numbers.
 
template<typename FT>
FT epsilon ()
 Function returning the epsilon value for a given type.
 
template<typename FT>
FT epsilon_sqr ()
 Function returning the squared epsilon value for a given type.
 
template<>
float epsilon< float > ()
 Function returning epsilon for float type numbers.
 
template<>
float epsilon_sqr< float > ()
 Function returning squared epsilon for float type numbers.
 
template<>
double epsilon< double > ()
 Function returning epsilon for double type numbers.
 
template<>
double epsilon_sqr< double > ()
 Function returning squared epsilon for double type numbers.
 
template<typename FT>
bool epsilon_equal (FT const &x, FT const &y, FT const &eps)
 Tests if two values are Epsilon equal.
 
template<typename FT>
bool epsilon_not_equal (FT const &x, FT const &y, FT const &eps)
 Tests if two values are not Epsilon equal.
 
std::ostream & operator<< (std::ostream &os, Graph::Vertex v)
 Output stream support for Graph::Vertex.
 
std::ostream & operator<< (std::ostream &os, Graph::Edge e)
 Output stream support for Graph::Edge.
 
template<typename T>
void hash_combine (uint64_t &seed, T const &value)
 Combines a hash value with a seed value.
 
template<typename FT>
uint64_t hash (const Vec< 2, FT > &value)
 Computes the hash value of a 2D vector.
 
template<typename FT>
uint64_t hash (const Vec< 3, FT > &value)
 Computes the hash value of a 3D vector.
 
template<int DIM, typename FT>
uint64_t hash (const Vec< DIM, FT > &value)
 Computes the hash value of a vector with a given dimension.
 
template<typename Iterator>
uint64_t hash (Iterator first, Iterator last)
 Computes the hash value of a 1D array.
 
template<typename Iterator>
void hash (uint64_t &seed, Iterator first, Iterator last)
 Computes the hash value of a 1D array with a given seed value.
 
template<int DIM, typename FT>
std::ostream & operator<< (std::ostream &os, const GenericLine< DIM, FT > &line)
 Output stream support for GenericLine.
 
template<int DIM, typename FT>
std::istream & operator>> (std::istream &is, GenericLine< DIM, FT > &line)
 Input stream support for GenericLine.
 
template<size_t N, size_t M, typename T>
Mat< N, M, T > operator* (T lhs, const Mat< N, M, T > &rhs)
 Multiplies a scalar by a matrix.
 
template<typename T>
Mat2< T > operator* (const Mat2< T > &lhs, const Mat2< T > &rhs)
 Specialized matrix-matrix multiplication for 2x2 matrices.
 
template<typename T>
Mat3< T > operator* (const Mat3< T > &lhs, const Mat3< T > &rhs)
 Specialized matrix-matrix multiplication for 3x3 matrices.
 
template<typename T>
Mat4< T > operator* (const Mat4< T > &lhs, const Mat4< T > &rhs)
 Specialized matrix-matrix multiplication for 4x4 matrices.
 
template<typename T>
Vec< 3, T > operator* (const Mat4< T > &lhs, const Vec< 3, T > &rhs)
 Specialized matrix-vector multiplication for 4x4 matrices and 3D vectors.
 
template<typename T>
Vec< 2, T > operator* (const Mat3< T > &lhs, const Vec< 2, T > &rhs)
 Specialized matrix-vector multiplication for 3x3 matrices and 2D vectors.
 
template<typename T>
Vec< 2, T > operator* (const Mat2< T > &lhs, const Vec< 2, T > &rhs)
 Non-homogeneous, specialized matrix-vector multiplication for 2x2 matrices and 2D vectors.
 
template<typename T>
Vec< 3, T > operator* (const Mat3< T > &lhs, const Vec< 3, T > &rhs)
 Non-homogeneous, specialized matrix-vector multiplication for 3x3 matrices and 3D vectors.
 
template<typename T>
Vec< 4, T > operator* (const Mat4< T > &lhs, const Vec< 4, T > &rhs)
 Non-homogeneous, specialized matrix-vector multiplication for 4x4 matrices and 4D vectors.
 
template<size_t N, typename T>
trace (const Mat< N, N, T > &m)
 Returns the trace (sum of elements on the main diagonal) of an N x N (square) matrix.
 
template<size_t N, typename T>
determinant (const Mat< N, N, T > &m)
 Computes the determinant of a square matrix.
 
template<size_t N, size_t M, typename T>
Mat< M, N, T > transpose (const Mat< N, M, T > &m)
 Transposes a matrix.
 
template<size_t N, typename T>
Mat< N, N, T > inverse (const Mat< N, N, T > &m)
 Returns the inverse of an N x N (square) matrix.
 
template<size_t M, size_t N, typename T>
Mat< N, M, T > tensor (const Vec< M, T > &u, const Vec< N, T > &v)
 Returns the tensor product (outer product) of vectors u and v, where u is treated as a column vector and v is treated as a row vector.
 
template<size_t N, size_t M, typename T>
bool gauss_jordan_elimination (const Mat< N, N, T > &a, const Mat< N, M, T > &b, Mat< N, N, T > *ainv, Mat< N, M, T > *x)
 Perform Gauss-Jordan elimination to solve a set of linear equations and additionally compute the inverse of the input coefficient matrix.
 
template<size_t N, typename T>
bool lu_decomposition (const Mat< N, N, T > &a, Mat< N, N, T > *alu, Vec< N, T > *rowp, T *d)
 Perform LU decomposition of a square matrix.
 
template<size_t N, typename T>
void lu_back_substitution (const Mat< N, N, T > &alu, const Vec< N, T > &rowp, const Vec< N, T > &b, Vec< N, T > *x)
 Solve a set of linear equations using outputs from lu_decomposition() as inputs.
 
template<size_t N, typename FT>
bool cholesky_decompose (const Mat< N, N, FT > &A, Mat< N, N, FT > &L)
 Perform Cholesky decomposition of a symmetric, positive-definite matrix.
 
template<size_t N, typename FT>
void cholesky_solve (const Mat< N, N, FT > &L, const Vec< N, FT > &b, Vec< N, FT > &x)
 Solve a set of linear equations using outputs from cholesky_decompose() as inputs.
 
template<size_t N, size_t M, typename T>
void cholesky_solve (const Mat< N, N, T > &L, const Mat< N, M, T > &B, Mat< N, M, T > &X)
 Solve a set of linear equations using outputs from cholesky_decompose() as inputs.
 
template<size_t N, size_t M, typename T>
std::ostream & operator<< (std::ostream &output, const Mat< N, M, T > &m)
 Output stream support for Mat.
 
template<size_t N, size_t M, typename T>
std::istream & operator>> (std::istream &input, Mat< N, M, T > &m)
 Input stream support for Mat.
 
template<size_t D, typename T>
trace (const Mat< D, D, T > &m)
 
template<typename T>
determinant (const Mat2< T > &m)
 
template<typename T>
determinant (const Mat3< T > &m)
 
template<typename T>
determinant (const Mat4< T > &m)
 
template<typename T>
Mat2< T > inverse (const Mat2< T > &m)
 
template<typename T>
Mat3< T > inverse (const Mat3< T > &m)
 
template<typename T>
Mat4< T > inverse (const Mat4< T > &m)
 
template<size_t N, typename FT>
Mat< N, 1, FT > to_matrix (const Vec< N, FT > &v)
 Convert a N-dimensional vector into a N by 1 matrix.
 
template<size_t N, typename FT>
Mat< 1, N, FT > transpose (const Vec< N, FT > &v)
 Construct a 1 by N matrix from a N-dimensional vector.
 
template<size_t N, size_t M, typename T>
bool has_nan (const Mat< N, M, T > &m)
 Test if a matrix has NaN entry.
 
template<typename FT>
std::ostream & operator<< (std::ostream &, const Matrix< FT > &)
 input and output
 
template<typename FT>
std::istream & operator>> (std::istream &, Matrix< FT > &)
 
template<typename FT>
Matrix< FT > operator- (const Matrix< FT > &)
 arithmetic operators
 
template<typename FT>
Matrix< FT > operator+ (const Matrix< FT > &, const FT &)
 
template<typename FT>
Matrix< FT > operator+ (const FT &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > operator+ (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > operator- (const Matrix< FT > &, const FT &)
 
template<typename FT>
Matrix< FT > operator- (const FT &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > operator- (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > operator* (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
std::vector< FT > operator* (const Matrix< FT > &, const std::vector< FT > &)
 
template<typename FT1, typename FT2>
Matrix< FT1 > operator* (const Matrix< FT1 > &A, const FT2 &s)
 matrix-scalar multiplication
 
template<typename FT1, typename FT2>
Matrix< FT1 > operator* (const FT2 &s, const Matrix< FT1 > &A)
 scalar-matrix multiplication
 
template<typename FT1, typename FT2>
Matrix< FT1 > operator/ (const Matrix< FT1 > &A, const FT2 &s)
 matrix-scalar division
 
template<typename FT1, typename FT2>
Matrix< FT1 > operator/ (const FT2 &s, const Matrix< FT1 > &A)
 scalar-matrix division
 
template<typename FT>
void mult (const Matrix< FT > &, const Matrix< FT > &, Matrix< FT > &)
 multiplication
 
template<typename FT>
void mult (const Matrix< FT > &, const std::vector< FT > &, std::vector< FT > &)
 
template<typename FT>
Matrix< FT > mult (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
std::vector< FT > mult (const Matrix< FT > &, const std::vector< FT > &)
 
template<typename FT>
Matrix< FT > elem_mult (const Matrix< FT > &, const Matrix< FT > &)
 element-wise multiplication / division
 
template<typename FT>
Matrix< FT > elem_divd (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > & elem_mult_eq (Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > & elem_divd_eq (Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > transpose (const Matrix< FT > &)
 transpose and conjugate transpose
 
template<typename FT>
Matrix< FT > conjugate_transpose (const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > transpose_mult (const Matrix< FT > &, const Matrix< FT > &)
 transpose multiplication
 
template<typename FT>
std::vector< FT > transpose_mult (const Matrix< FT > &, const std::vector< FT > &)
 
template<typename FT>
Matrix< FT > mult_transpose (const Matrix< FT > &, const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > mult_transpose (const std::vector< FT > &, const std::vector< FT > &)
 
template<typename FT>
Matrix< FT > random (int row, int col)
 Generate a matrix with all its elements randomly initialized in the range [0.0, 1.0].
 
template<typename FT>
Matrix< FT > identity (int N, const FT &v=FT(1))
 
template<typename FT>
Matrix< FT > diagonal (const std::vector< FT > &)
 diagonal matrix
 
template<typename FT>
std::vector< FT > diagonal (const Matrix< FT > &)
 
template<typename FT>
FT trace (const Matrix< FT > &)
 
template<typename FT>
FT norm (const Matrix< FT > &)
 utilities
 
template<typename FT>
void swap (Matrix< FT > &, Matrix< FT > &)
 
template<typename FT>
std::vector< FT > sum (const Matrix< FT > &)
 
template<typename FT>
std::vector< FT > min (const Matrix< FT > &)
 
template<typename FT>
std::vector< FT > max (const Matrix< FT > &)
 
template<typename FT>
std::vector< FT > mean (const Matrix< FT > &)
 
template<typename FT>
Matrix< FT > abs (const Matrix< std::complex< FT > > &A)
 Get magnitude of a std::complex matrix.
 
template<typename FT>
Matrix< FT > arg (const Matrix< std::complex< FT > > &A)
 Get angle of a std::complex matrix.
 
template<typename FT>
Matrix< FT > real (const Matrix< std::complex< FT > > &A)
 Get real part of a std::complex matrix.
 
template<typename FT>
Matrix< FT > imag (const Matrix< std::complex< FT > > &A)
 Get imaginary part of a std::complex matrix.
 
template<typename FT>
Matrix< std::complex< FT > > complex_matrix (const Matrix< FT > &)
 Convert real matrix to complex matrix.
 
template<typename FT>
Matrix< std::complex< FT > > complex_matrix (const Matrix< FT > &mR, const Matrix< FT > &mI)
 Convert real matrix to std::complex matrix (A for real, B for imaginary)
 
template<typename FT>
std::ostream & operator<< (std::ostream &, const std::vector< FT > &)
 input and output
 
template<typename FT>
std::istream & operator>> (std::istream &in, std::vector< FT > &A)
 Input stream support for std::vector<FT>.
 
template<typename FT>
std::vector< FT > operator- (const std::vector< FT > &)
 arithmetic operators
 
template<typename FT>
std::vector< FT > operator+ (const std::vector< FT > &A, const std::vector< FT > &B)
 vector-vector addition
 
template<typename FT>
std::vector< FT > operator+ (const std::vector< FT > &A, const FT &s)
 vector-scalar addition.
 
template<typename FT>
std::vector< FT > operator+ (const FT &s, const std::vector< FT > &A)
 scalar-vector addition.
 
template<typename FT>
std::vector< FT > operator- (const std::vector< FT > &A, const std::vector< FT > &B)
 vector-vector subtraction
 
template<typename FT>
std::vector< FT > operator- (const std::vector< FT > &A, const FT &s)
 vector-scalar subtraction.
 
template<typename FT>
std::vector< FT > operator- (const FT &s, const std::vector< FT > &A)
 scalar-vector subtraction.
 
template<typename FT1, typename FT2>
std::vector< FT1 > operator* (const std::vector< FT1 > &A, const FT2 &s)
 vector-scalar multiplication
 
template<typename FT1, typename FT2>
std::vector< FT1 > operator* (const FT2 &s, const std::vector< FT1 > &A)
 vector-scalar multiplication
 
template<typename FT1, typename FT2>
std::vector< FT1 > operator/ (const std::vector< FT1 > &A, const FT2 &s)
 vector-scalar division
 
template<typename FT1, typename FT2>
std::vector< FT1 > operator/ (const FT2 &s, const std::vector< FT1 > &A)
 vector-scalar division
 
template<typename FT>
std::vector< FT > elem_mult (const std::vector< FT > &, const std::vector< FT > &)
 element-wise multiplication / division
 
template<typename FT>
std::vector< FT > elem_divd (const std::vector< FT > &v1, const std::vector< FT > &v2)
 vector-vector element-wise division
 
template<typename FT>
std::vector< FT > & elem_mult_eq (std::vector< FT > &v1, const std::vector< FT > &v2)
 vector-vector element-wise multiplication: v1 *= v2.
 
template<typename FT>
std::vector< FT > & elem_divd_eq (std::vector< FT > &v1, const std::vector< FT > &v2)
 vector-vector element-wise division: v1 /= v2.
 
template<typename FT>
FT operator* (const std::vector< FT > &, const std::vector< FT > &)
 dot product
 
template<typename FT>
FT dot (const std::vector< FT > &v1, const std::vector< FT > &v2)
 Inner product for vectors.
 
template<typename FT>
std::vector< FT > random (int size)
 Generate a vector with all its elements randomly initialized in the range [0.0, 1.0].
 
template<typename FT>
FT norm (const std::vector< FT > &)
 utilities
 
template<typename FT>
FT norm (const std::vector< std::complex< FT > > &)
 Euclidean norm.
 
template<typename FT>
void swap (std::vector< FT > &, std::vector< FT > &)
 Euclidean norm.
 
template<typename FT>
std::vector< FT > linspace (FT, FT, int)
 Swap two vectors.
 
template<typename FT>
FT sum (const std::vector< FT > &)
 Generates a vector of n points linearly spaced between and including a and b.
 
template<typename FT>
FT min (const std::vector< FT > &)
 vector sum.
 
template<typename FT>
FT max (const std::vector< FT > &)
 Minimum value of vector.
 
template<typename FT>
FT mean (const std::vector< FT > &)
 Maximum value of vector.
 
template<typename FT>
std::vector< FT > abs (const std::vector< std::complex< FT > > &)
 Mean value of vector.
 
template<typename FT>
std::vector< FT > arg (const std::vector< std::complex< FT > > &)
 Get magnitude of a complex vector.
 
template<typename FT>
std::vector< FT > real (const std::vector< std::complex< FT > > &)
 Get angle of a complex vector.
 
template<typename FT>
std::vector< FT > imag (const std::vector< std::complex< FT > > &)
 Get real part of a complex vector.
 
template<typename FT>
std::vector< std::complex< FT > > complex_vector (const std::vector< FT > &)
 Get imaginary part of a complex vector.
 
template<typename FT>
std::vector< std::complex< FT > > complex_vector (const std::vector< FT > &vR, const std::vector< FT > &vI)
 Convert real vector to complex vector (A for real, B for imaginary)
 
double determinant (const MATRIX &A)
 
bool inverse (const MATRIX &A, MATRIX &invA)
 
MATRIX inverse (const MATRIX &A)
 
void svd_decompose (const MATRIX &A, MATRIX &U, MATRIX &S, MATRIX &V)
 
bool solve_least_squares (const MATRIX &A, const std::vector< double > &b, std::vector< double > &x)
 
template<class T>
Sign sign (T x)
 returns the sign of a value.
 
template<typename FT>
std::ostream & operator<< (std::ostream &os, const GenericPlane< FT > &plane)
 Output stream support for GenericPlane.
 
template<typename FT>
std::istream & operator>> (std::istream &is, GenericPlane< FT > &plane)
 Input stream support for GenericPlane.
 
std::ostream & operator<< (std::ostream &os, PointCloud::Vertex v)
 Output stream support for PointCloud::Vertex.
 
std::ostream & operator<< (std::ostream &os, PolyMesh::Vertex v)
 Output stream support for PolyMesh::Vertex.
 
std::ostream & operator<< (std::ostream &os, PolyMesh::Edge e)
 Output stream support for PolyMesh::Edge.
 
std::ostream & operator<< (std::ostream &os, PolyMesh::HalfFace h)
 Output stream support for PolyMesh::HalfFace.
 
std::ostream & operator<< (std::ostream &os, PolyMesh::Face f)
 Output stream support for PolyMesh::Face.
 
std::ostream & operator<< (std::ostream &os, PolyMesh::Cell c)
 Output stream support for PolyMesh::Cell.
 
template<typename FT>
std::ostream & operator<< (std::ostream &os, const Quat< FT > &Q)
 Output stream support for Quat.
 
template<typename FT>
std::istream & operator>> (std::istream &is, Quat< FT > &Q)
 Input stream support for Quat.
 
template<class FT>
bool has_nan (const Quat< FT > &Q)
 Do the coordinates of the quaternion have NaN?
 
float random_float ()
 Random real in [0, 1].
 
float random_float (float min, float max)
 Random real number in the range [min, max].
 
vec3 random_color (bool allow_dark=false)
 Generates a random color. The parameter allow_dark controls if too dark colors are allowed.
 
std::ostream & operator<< (std::ostream &os, SurfaceMesh::Vertex v)
 Output stream support for SurfaceMesh::Vertex.
 
std::ostream & operator<< (std::ostream &os, SurfaceMesh::Halfedge h)
 Output stream support for SurfaceMesh::Halfedge.
 
std::ostream & operator<< (std::ostream &os, SurfaceMesh::Edge e)
 Output stream support for SurfaceMesh::Edge.
 
std::ostream & operator<< (std::ostream &os, SurfaceMesh::Face f)
 Output stream support for SurfaceMesh::Face.
 
template<typename FT>
bool is_nan (FT v)
 Is this NaN?
 
template<class T>
clamp (T x, T lower, T upper)
 Clamps a num to be within a given range.
 
int next_pow2 (int a)
 Calculates the next larger power of 2. If the input is already a power of 2, it will return itself.
 
template<class FT>
FT truncate_digits (const FT &v, int num)
 Rounds the given floating point number v to have num digits.
 
template<size_t N, class T>
dot (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Computes the dot product of two vectors.
 
template<size_t N, class T>
Vec< N, T > operator- (const Vec< N, T > &v1)
 Computes the 'negative' vector.
 
template<class T2, size_t N, class T>
Vec< N, T > operator* (T2 s, const Vec< N, T > &v)
 Computes the scalar-vector product.
 
template<size_t N, class T>
Vec< N, T > operator+ (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Computes the addition of two vectors.
 
template<size_t N, class T>
Vec< N, T > operator- (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Computes the subtraction of two vectors.
 
template<size_t N, class T>
length (const Vec< N, T > &v)
 Computes the length/magnitude of a vector.
 
template<size_t N, class T>
norm (const Vec< N, T > &v)
 Computes the length/magnitude of a vector.
 
template<size_t N, class T>
length2 (const Vec< N, T > &v)
 Computes the squared length/magnitude of a vector.
 
template<size_t N, class T>
distance (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Computes the distance between two vectors/points.
 
template<size_t N, class T>
distance2 (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Computes the squared distance between two vectors/points.
 
template<size_t N, class T>
Vec< N, T > normalize (const Vec< N, T > &v)
 Computes and returns the normalized vector (Note: the input vector is not modified).
 
template<size_t N, class T>
Vec< N, T > mix (const Vec< N, T > &v1, const Vec< N, T > &v2, T w)
 
template<class T>
dot (const Vec< 2, T > &v1, const Vec< 2, T > &v2)
 Compute the dot product of two 2D vectors.
 
template<class T>
det (const Vec< 2, T > &v1, const Vec< 2, T > &v2)
 Compute the determinant of the 2x2 matrix formed by the two 2D vectors as the two rows.
 
template<class T>
Vec< 2, T > operator- (const Vec< 2, T > &v1)
 The negative vector.
 
template<class T2, class T>
Vec< 2, T > operator* (T2 s, const Vec< 2, T > &v)
 Scalar-vector multiplication.
 
template<class T>
Vec< 2, T > operator+ (const Vec< 2, T > &v1, const Vec< 2, T > &v2)
 Vector-vector addition.
 
template<class T>
Vec< 2, T > operator- (const Vec< 2, T > &v1, const Vec< 2, T > &v2)
 Vector-vector subtraction.
 
template<class T>
dot (const Vec< 3, T > &v1, const Vec< 3, T > &v2)
 Compute the dot product of two 3D vectors.
 
template<class T>
Vec< 3, T > cross (const Vec< 3, T > &v1, const Vec< 3, T > &v2)
 Compute the cross product of two 3D vectors.
 
template<class T>
Vec< 3, T > operator- (const Vec< 3, T > &v1)
 The negative vector.
 
template<class T2, class T>
Vec< 3, T > operator* (T2 s, const Vec< 3, T > &v)
 Scalar-vector multiplication.
 
template<class T>
Vec< 3, T > operator+ (const Vec< 3, T > &v1, const Vec< 3, T > &v2)
 Vector-vector addition.
 
template<class T>
Vec< 3, T > operator- (const Vec< 3, T > &v1, const Vec< 3, T > &v2)
 Vector-vector subtraction.
 
template<class T>
Vec< 3, T > orthogonal (const Vec< 3, T > &v)
 Compute a vector that is orthogonal to the given vector.
 
template<class T>
dot (const Vec< 4, T > &v1, const Vec< 4, T > &v2)
 Compute the dot product of two 4D vectors.
 
template<class T>
Vec< 4, T > operator- (const Vec< 4, T > &v1)
 The negative vector.
 
template<class T2, class T>
Vec< 4, T > operator* (T2 s, const Vec< 4, T > &v)
 Scalar-vector multiplication.
 
template<class T>
Vec< 4, T > operator+ (const Vec< 4, T > &v1, const Vec< 4, T > &v2)
 Vector-vector addition.
 
template<class T>
Vec< 4, T > operator- (const Vec< 4, T > &v1, const Vec< 4, T > &v2)
 Vector-vector subtraction.
 
template<size_t N, class T>
std::ostream & operator<< (std::ostream &out, const Vec< N, T > &v)
 Output stream support for Vec.
 
template<size_t N, class T>
std::istream & operator>> (std::istream &in, Vec< N, T > &v)
 Input stream support for Vec.
 
template<class T>
std::ostream & operator<< (std::ostream &out, const Vec< 2, T > &v)
 Output stream support specialized for 2D vectors.
 
template<class T>
std::istream & operator>> (std::istream &in, Vec< 2, T > &v)
 Input stream support specialized for 2D vectors.
 
template<class T>
std::ostream & operator<< (std::ostream &out, const Vec< 3, T > &v)
 Output stream support specialized for 3D vectors.
 
template<class T>
std::istream & operator>> (std::istream &in, Vec< 3, T > &v)
 Input stream support specialized for 3D vectors.
 
template<class T>
std::ostream & operator<< (std::ostream &out, const Vec< 4, T > &v)
 Output stream support specialized for 4D vectors.
 
template<class T>
std::istream & operator>> (std::istream &in, Vec< 4, T > &v)
 Input stream support specialized for 4D vectors.
 
template<size_t N, class T>
bool has_nan (const Vec< N, T > &v)
 Do the coordinates of a vector have NaN?
 
template<size_t N, class T>
bool operator== (const Vec< N, T > &a, const Vec< N, T > &b)
 Test if two vectors are strictly identical.
 
template<size_t N, class T>
bool operator!= (const Vec< N, T > &a, const Vec< N, T > &b)
 Test if two vectors are strictly not identical.
 
template<size_t N, class T>
bool operator< (const Vec< N, T > &a, const Vec< N, T > &b)
 Lexicographic comparison of two vectors.
 
template<size_t N, class T>
Vec< N, T > comp_product (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Component-wise product of two vectors.
 
template<size_t N, class T>
Vec< N, T > comp_min (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Component-wise minimum vector.
 
template<size_t N, class T>
Vec< N, T > comp_max (const Vec< N, T > &v1, const Vec< N, T > &v2)
 Component-wise maximum vector.
 
template<size_t N, class T>
min_coord (const Vec< N, T > &a)
 The minimum coordinate of elements in a vector.
 
template<size_t N, class T>
max_coord (const Vec< N, T > &a)
 The maximum coordinate of elements in a vector.
 
template<size_t N, class T>
Vec< N, T > clamp (const Vec< N, T > &a, const Vec< N, T > &lower, const Vec< N, T > &upper)
 Component-wise clamp.
 
void discretize_image (std::vector< unsigned char > &data, int width, int height, int channels, int num_stripes)
 Discretize a gradually varying-color (from left to right) image into a set of uniform colored vertical stripes.
 
void initialize (bool info_to_stdout=false, bool use_log_file=true, bool use_setting_file=false, const std::string &resource_dir=Easy3D_RESOURCE_DIR)
 Initialization of Easy3D.
 
void print_progress (float percentage)
 A simple progress indicator for console applications.
 
int version_major ()
 returns the major version number of Easy3D.
 
int version_minor ()
 returns the major version number of Easy3D.
 
int version_patch ()
 returns the minor version number of Easy3D.
 
std::string version_string ()
 returns the version string of Easy3D, in the format [MAJOR].[MINOR].[PATCH], e.g., “2.5.3”.
 
std::size_t version_number ()
 returns the version number of Easy3D, in the format 10[MAJOR]0[MINOR]0[PATCH], e.g., 1020503.
 
std::size_t release_date ()
 returns the release date of Easy3D, in the format YYYYMMDD, e.g., 20240305.
 
Global methods for connection and disconnection.
template<typename SIGNAL, typename FUNCTION>
int connect (SIGNAL *signal, FUNCTION const &slot)
 Connects a function to the signal.
 
template<typename SIGNAL, typename CLASS, typename FUNCTION>
int connect (SIGNAL *signal, CLASS *inst, FUNCTION const &slot)
 Connects a member function of an object to this Signal.
 
template<typename... Args>
int connect (Signal< Args... > *sender, Signal< Args... > *receiver)
 Connects this signal to another signal.
 
template<typename SIGNAL>
void disconnect (SIGNAL *signal, int id)
 Disconnects a previously connected function.
 
template<typename SIGNAL>
void disconnect_all (SIGNAL *signal)
 Disconnects all previously connected functions.
 
Helper functions for resolving overloaded functions.
template<typename... Args>
constexpr auto overload (void(*func)(Args...)) -> void(*)(Args...)
 Helper function for resolving overloaded non-member functions.
 
template<typename C, typename... Args>
constexpr auto overload (void(C::*func)(Args...)) -> void(C::*)(Args...)
 Helper function for resolving overloaded member functions.
 

Detailed Description


The code is adapted from libQGLViewer with modifications.

libQGLViewer is a C++ library based on Qt that eases the creation of OpenGL 3D viewers.


Gathers different basic types for geometric operations. Types defined here are points/vectors, lines, segments, planes, boxes and matrices in 2D and 3D.


the code is adapted from Surface_mesh with modifications and significant enhancement.

Surface_mesh is a halfedge-based mesh data structure for representing and processing 2-manifold polygonal surface meshes. It is implemented in C++ and designed with an emphasis on simplicity and efficiency.



the code is adapted from libQGLViewer with modifications.

libQGLViewer is a C++ library based on Qt that eases the creation of OpenGL 3D viewers.



The code in this file is adapted from libQGLViewer with significant modifications and enhancement.



the code is adapted from ShaderProgram with modifications.

This class allows to create programs, load shaders from files, associate vertex attribute names with locations, and work with uniforms, including blocks. It also provides access to the info logs, and many more useful functionalities.



the code is adapted from ShaderProgram with modifications.


Function Documentation

◆ abs()

template<typename FT>
std::vector< FT > abs ( const std::vector< std::complex< FT > > & v)

Mean value of vector.

Get magnitude of a complex vector.

◆ arg()

template<typename FT>
std::vector< FT > arg ( const std::vector< std::complex< FT > > & v)

Get magnitude of a complex vector.

Get angle of a complex vector.

◆ cholesky_decompose()

template<size_t N, typename FT>
bool cholesky_decompose ( const Mat< N, N, FT > & A,
Mat< N, N, FT > & L )

Perform Cholesky decomposition of a symmetric, positive-definite matrix.

For a symmetric, positive definite matrix A, this function computes the Cholesky factorization, i.e. it computes a lower triangular matrix L such that A = L * L'. If the matrix is not symmetric or positive definite, the function computes only a partial decomposition.

Template Parameters
NThe number of rows and columns in the input matrix.
FTThe scalar type for matrix elements.
Parameters
AThe N x N input matrix.
LOutput N x N lower triangular matrix such that A = L * L^T.
Returns
true on success (the input matrix is symmetric, positive definite, and then the factorization was successful), false if A is not positive-definite.

◆ cholesky_solve() [1/2]

template<size_t N, typename FT>
void cholesky_solve ( const Mat< N, N, FT > & L,
const Vec< N, FT > & b,
Vec< N, FT > & x )

Solve a set of linear equations using outputs from cholesky_decompose() as inputs.

Template Parameters
NThe number of rows and columns in the input matrix.
FTThe scalar type for matrix elements.
Parameters
LThe N x N lower triangular matrix, which is the result of a call to cholesky_decompose().
bThe N-dimensional input right-hand vector.
xOutput N-dimensional solution set.

◆ cholesky_solve() [2/2]

template<size_t N, size_t M, typename T>
void cholesky_solve ( const Mat< N, N, T > & L,
const Mat< N, M, T > & B,
Mat< N, M, T > & X )

Solve a set of linear equations using outputs from cholesky_decompose() as inputs.

It can also be used to solve for the inverse of a symmetric, positive definite matrix, by using B = I.

Template Parameters
NThe number of rows and columns in the input matrix.
MThe number of columns in the right-hand side matrix.
TThe scalar type for matrix elements.
Parameters
LThe N x N lower triangular matrix, which is the result of a call to cholesky_decompose().
BThe N x M input matrix containing right-hand vectors.
XOutput N x M solution set.

◆ complex_matrix()

template<typename FT>
Matrix< std::complex< FT > > complex_matrix ( const Matrix< FT > & rA)

Convert real matrix to complex matrix.

Convert real matrix to std::complex matrix.

◆ complex_vector()

template<typename FT>
std::vector< std::complex< FT > > complex_vector ( const std::vector< FT > & rv)

Get imaginary part of a complex vector.

Convert real vector to complex vector.

◆ conjugate_transpose()

template<typename FT>
Matrix< FT > conjugate_transpose ( const Matrix< FT > & A)

matrix conjugate transpose

◆ connect() [1/3]

template<typename SIGNAL, typename CLASS, typename FUNCTION>
int connect ( SIGNAL * signal,
CLASS * inst,
FUNCTION const & slot )
inline

Connects a member function of an object to this Signal.

The returned value can be used to disconnect the function from this signal.

easy3d::connect(&kfi_->interpolation_stopped, viewer, &Viewer::update);
void update() const
Update the display (i.e., repaint).
Definition viewer.cpp:630
int connect(SIGNAL *signal, FUNCTION const &slot)
Connects a function to the signal.
Definition signal.h:200
Note
When a member function has overloads, explicitly cast the function to the right function type, e.g.,
static_cast<void (Viewer::*)(const std::string&, int)>(&Viewer::print)
The built-in Easy3D viewer.
Definition viewer.h:63
Or use the helper function overload for a lighter syntax.

◆ connect() [2/3]

template<typename SIGNAL, typename FUNCTION>
int connect ( SIGNAL * signal,
FUNCTION const & slot )
inline

Connects a function to the signal.

The returned value can be used to disconnect the function from this signal.

Note
When a function has overloads, explicitly cast the function to the right function type, e.g.,
static_cast<void (*)(const std::string&, int)>(&print)
Or use the helper function overload for a lighter syntax.
Examples
Tutorial_203_Viewer_wxWidgets/main.cpp, Tutorial_204_Viewer_Qt/main.cpp, and Tutorial_206_CameraInterpolation/main.cpp.

◆ connect() [3/3]

template<typename... Args>
int connect ( Signal< Args... > * sender,
Signal< Args... > * receiver )

Connects this signal to another signal.

Upon return, the emission of this signal will trigger another to be emitted. The returned value can be used to disconnect the connected signal.

◆ determinant() [1/5]

template<typename T>
T determinant ( const Mat2< T > & m)

Partial specialization for computing the determinant of a 2x2 matrix.

◆ determinant() [2/5]

template<typename T>
T determinant ( const Mat3< T > & m)

Partial specialization for computing the determinant of a 3x3 matrix.

◆ determinant() [3/5]

template<typename T>
T determinant ( const Mat4< T > & m)

Partial specialization for computing the determinant of a 4x4 matrix.

◆ determinant() [4/5]

template<size_t N, typename T>
T determinant ( const Mat< N, N, T > & m)

Computes the determinant of a square matrix.

This function calculates the determinant of an N x N matrix using LU decomposition for general cases.

Template Parameters
NThe number of rows and columns in the matrix.
TThe scalar type for matrix elements.
Parameters
mThe N x N matrix whose determinant is to be computed.
Returns
The determinant of the matrix.
Note
This function is specialized for matrices up to 4x4 for better performance.

Compute the determinant of a square matrix.

◆ determinant() [5/5]

double determinant ( const MATRIX & A)

Compute the determinant of a square matrix.

Parameters
AThe input matrix.
Returns
The determinant of A.

◆ diagonal() [1/2]

template<typename FT>
std::vector< FT > diagonal ( const Matrix< FT > & A)

Get the diagonal entries of matrix.

◆ diagonal() [2/2]

template<typename FT>
Matrix< FT > diagonal ( const std::vector< FT > & d)

diagonal matrix

Generate the diagonal of matrix by given its diagonal elements.

◆ discretize_image()

void discretize_image ( std::vector< unsigned char > & data,
int width,
int height,
int channels,
int num_stripes )

Discretize a gradually varying-color (from left to right) image into a set of uniform colored vertical stripes.

Parameters
dataThe input data to be discrete.
widthThe width of the image (i.e., number of pixels in a row).
heightThe height of the image (i.e., number of pixels in a column).
channelsThe number of color components per pixel.
num_stripesThe number of stripes. The image will remain unmodified if num_stripes >= image width.

◆ elem_divd()

template<typename FT>
Matrix< FT > elem_divd ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline
  • matrix-matrix element-wise division

◆ elem_divd_eq()

template<typename FT>
Matrix< FT > & elem_divd_eq ( Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline
  • matrix-matrix element-wise division

◆ elem_mult() [1/2]

template<typename FT>
Matrix< FT > elem_mult ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline

element-wise multiplication / division

matrix-matrix element-wise multiplication

◆ elem_mult() [2/2]

template<typename FT>
std::vector< FT > elem_mult ( const std::vector< FT > & v1,
const std::vector< FT > & v2 )
inline

element-wise multiplication / division

vector-vector element-wise multiplication

◆ elem_mult_eq()

template<typename FT>
Matrix< FT > & elem_mult_eq ( Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline

matrix-matrix element-wise multiplication

◆ epsilon()

template<typename FT>
FT epsilon ( )

Function returning the epsilon value for a given type.

Template Parameters
FTThe floating point type.
Returns
The epsilon value.

◆ epsilon< double >()

template<>
double epsilon< double > ( )
inline

Function returning epsilon for double type numbers.

Returns
The epsilon value for double.

◆ epsilon< float >()

template<>
float epsilon< float > ( )
inline

Function returning epsilon for float type numbers.

Returns
The epsilon value for float.

◆ epsilon_equal()

template<typename FT>
bool epsilon_equal ( FT const & x,
FT const & y,
FT const & eps )

Tests if two values are Epsilon equal.

Template Parameters
FTThe floating point type.
Parameters
xThe first value.
yThe second value.
epsThe epsilon value.
Returns
True if the values are Epsilon equal, false otherwise.

◆ epsilon_not_equal()

template<typename FT>
bool epsilon_not_equal ( FT const & x,
FT const & y,
FT const & eps )

Tests if two values are not Epsilon equal.

Template Parameters
FTThe floating point type.
Parameters
xThe first value.
yThe second value.
epsThe epsilon value.
Returns
True if the values are not Epsilon equal, false otherwise.

◆ epsilon_sqr()

template<typename FT>
FT epsilon_sqr ( )

Function returning the squared epsilon value for a given type.

Template Parameters
FTThe floating point type.
Returns
The squared epsilon value.

◆ epsilon_sqr< double >()

template<>
double epsilon_sqr< double > ( )
inline

Function returning squared epsilon for double type numbers.

Returns
The squared epsilon value for double.

◆ epsilon_sqr< float >()

template<>
float epsilon_sqr< float > ( )
inline

Function returning squared epsilon for float type numbers.

Returns
The squared epsilon value for float.

◆ extrude() [1/2]

SurfaceMesh * extrude ( const std::vector< Polygon2 > & contours,
float height )

Extrudes a 3D surface mesh from a set of simple contours.

Parameters
contoursThe input contours, which must be simple, i.e.,
  • free of intersections,
  • CCW contours defining the outer boundary and CW contours defining holes. Simple contours can be obtained using the tessellator.
heightThe height (in the Z direction) of the extruded 3D model.
Returns
The extruded surface mesh model. NULL on failure.

◆ extrude() [2/2]

bool extrude ( SurfaceMesh * mesh,
const std::vector< Polygon2 > & contours,
float height )

Extrudes a 3D surface mesh from a set of simple contours.

Parameters
meshThe output mesh model. Must be allocated beforehand.
contoursThe input contours, which must be simple, i.e.,
  • free of intersections,
  • CCW contours defining the outer boundary and CW contours defining holes. Simple contours can be obtained using the tessellator.
heightThe height (in the Z direction) of the extruded 3D model.
Returns
True on success and false on failure.

◆ gauss_jordan_elimination()

template<size_t N, size_t M, typename T>
bool gauss_jordan_elimination ( const Mat< N, N, T > & a,
const Mat< N, M, T > & b,
Mat< N, N, T > * ainv,
Mat< N, M, T > * x )

Perform Gauss-Jordan elimination to solve a set of linear equations and additionally compute the inverse of the input coefficient matrix.

Template Parameters
NThe number of rows and columns in the input matrix.
MThe number of columns in the right-hand side matrix.
TThe scalar type for matrix elements.
Parameters
aThe N x N input matrix.
bThe N x M input matrix containing right-hand vectors.
ainvOutput inverse of a. This may safely be the same location as a (a will be overwritten).
xOutput solution set. This may safely be the same location as b (b will be overwritten).
Returns
true on success, false if a is a singular matrix.

◆ has_nan()

template<int DIM, typename FT>
bool has_nan ( const GenericBox< DIM, FT > & box)

Check if the representation of a box has NaN.

Template Parameters
DIMThe dimension.
FTThe floating point type.
Parameters
boxThe box to check.
Returns
True if the box has NaN, false otherwise.

◆ hash() [1/5]

template<typename FT>
uint64_t hash ( const Vec< 2, FT > & value)

Computes the hash value of a 2D vector.

Template Parameters
FTThe floating point type.
Parameters
valueThe 2D vector to hash.
Returns
The computed hash value.

◆ hash() [2/5]

template<typename FT>
uint64_t hash ( const Vec< 3, FT > & value)

Computes the hash value of a 3D vector.

Template Parameters
FTThe floating point type.
Parameters
valueThe 3D vector to hash.
Returns
The computed hash value.

◆ hash() [3/5]

template<int DIM, typename FT>
uint64_t hash ( const Vec< DIM, FT > & value)

Computes the hash value of a vector with a given dimension.

Template Parameters
DIMThe dimension of the vector.
FTThe floating point type.
Parameters
valueThe vector to hash.
Returns
The computed hash value.

◆ hash() [4/5]

template<typename Iterator>
uint64_t hash ( Iterator first,
Iterator last )

Computes the hash value of a 1D array.

Template Parameters
IteratorThe type of the iterator.
Parameters
firstThe iterator pointing to the first element.
lastThe iterator pointing to the past-the-end element.
Returns
The computed hash value.

◆ hash() [5/5]

template<typename Iterator>
void hash ( uint64_t & seed,
Iterator first,
Iterator last )

Computes the hash value of a 1D array with a given seed value.

Template Parameters
IteratorThe type of the iterator.
Parameters
seedThe seed value to combine with.
firstThe iterator pointing to the first element.
lastThe iterator pointing to the past-the-end element.

◆ hash_combine()

template<typename T>
void hash_combine ( uint64_t & seed,
T const & value )

Combines a hash value with a seed value.

std::size_t has 64 bits on most systems, but 32 bits on 32-bit Windows. To make the same code robustly run on both 32-bit and 64-bit systems, Easy3D uses 64-bit integer for hash values. This function implements the 64-bit hash combine algorithm (inspired by the Hash128to64 function in CityHash).

Template Parameters
TThe type of the value to hash.
Parameters
seedThe seed value to combine with.
valueThe value to hash.

◆ identity()

template<typename FT>
Matrix< FT > identity ( int N,
const FT & x = FT(1) )

Generate an unity/identity matrix (i.e., all elements on the diagonal have a value of 1).

Note
This function also allow to set the elements on the diagonal to have values other than 1.

Generate an identity matrix.

◆ imag()

template<typename FT>
std::vector< FT > imag ( const std::vector< std::complex< FT > > & v)

Get real part of a complex vector.

Get imaginary part of a complex vector.

◆ initialize()

void initialize ( bool info_to_stdout = false,
bool use_log_file = true,
bool use_setting_file = false,
const std::string & resource_dir = Easy3D_RESOURCE_DIR )

Initialization of Easy3D.

This function initializes logging, setting, and resources. Internally it calls (and is thus identical to calling) logging::initialize(), setting::initialize(), and resource::initialize(). For more fine-grained initializations, please refer to the documentation of these functions.

Parameters
info_to_stdouttrue to log messages at a the INFO level to standard output. WARNING and ERROR (including FATAL) levels are always logged to standard output.
use_log_fileTrue to create a ".log" file (which will be created next to the executable program).
use_setting_fileTrue to create an ".ini" file (which will be created next to the executable program). This setting file stores the default rendering parameters. Users can modify this file to change the default rendering parameters, then the changes will be effective for the future.
resource_dirThe resource directory containing color maps, shaders, textures, fonts, etc. Easy3D_RESOURCE_DIR is the default value, which is the directory coming with the Easy3D distribution. In most cases you should use the default resource directory (unless you want to use different resources).
See also
logging::initialize(), setting::initialize(), and resource::initialize().

◆ inverse() [1/6]

template<typename T>
Mat2< T > inverse ( const Mat2< T > & m)

Partial specialization for computing the inverse of a 2x2 matrix.

◆ inverse() [2/6]

template<typename T>
Mat3< T > inverse ( const Mat3< T > & m)

Partial specialization for computing the inverse of a 3x3 matrix.

◆ inverse() [3/6]

template<typename T>
Mat4< T > inverse ( const Mat4< T > & m)

Partial specialization for computing the inverse of a 4x4 matrix.

◆ inverse() [4/6]

template<size_t N, typename T>
Mat< N, N, T > inverse ( const Mat< N, N, T > & m)

Returns the inverse of an N x N (square) matrix.

Template Parameters
NThe number of rows and columns in the matrix.
TThe scalar type for matrix elements.
Parameters
mThe matrix to invert.
Returns
The inverse of the matrix.
Note
This is specialized for matrices up to 4x4 in order to achieve better performance. The general case uses Gauss-Jordan elimination (which uses less memory than the LU decomposition).

Compute the inverse of a square matrix.

Examples
Tutorial_203_Viewer_wxWidgets/main.cpp, and Tutorial_204_Viewer_Qt/main.cpp.

◆ inverse() [5/6]

MATRIX inverse ( const MATRIX & A)

Compute the inverse of a square matrix. This is a wrapper around Eigen's inverse function.

Parameters
AThe input matrix.
Returns
The inverse of A.

◆ inverse() [6/6]

bool inverse ( const MATRIX & A,
MATRIX & invA )

Compute the inverse of a square matrix. This is a wrapper around Eigen's inverse function.

Parameters
AThe input matrix.
invAThe inverse of A.
Returns
false if failed (failure is reported only if the input matrix is not square). Upon return, invA carries the inverse of A.

◆ linspace()

template<typename FT>
std::vector< FT > linspace ( FT a,
FT b,
int n )

Swap two vectors.

Generates a vector of n points linearly spaced between and including a and b.

◆ lu_back_substitution()

template<size_t N, typename T>
void lu_back_substitution ( const Mat< N, N, T > & alu,
const Vec< N, T > & rowp,
const Vec< N, T > & b,
Vec< N, T > * x )

Solve a set of linear equations using outputs from lu_decomposition() as inputs.

Template Parameters
NThe number of rows and columns in the input matrix.
TThe scalar type for matrix elements.
Parameters
aluThe N x N matrix, which is the result of a call to lu_decomposition().
rowpThe row permutation data for alu, which is the result of a call to lu_decomposition().
bThe N-dimensional input right-hand vector.
xOutput N-dimensional solution set.

Example for solving a linear system:

// inputs:
Mat<N, N, T> a; // input rhs matrix
Vec<N, T> b; // input lhs vector
// outputs:
Mat<N, N, T> alu; // result of LU decomposition
Vec<N, size_t> rowp; // result row permutation data for alu
T d; // sign of determinant
Vec<N, size_t> x; // result solution set
...
lu_decomposition(a, &alu, &rowp, &d); // get lu decomposition
lu_back_substitution(alu, rowp, b, &x); // get solution set
Base class for matrix types.
Definition mat.h:64
Base class for vector types. It provides generic functionality for N dimensional vectors.
Definition vec.h:30
void lu_back_substitution(const Mat< N, N, T > &alu, const Vec< N, T > &rowp, const Vec< N, T > &b, Vec< N, T > *x)
Solve a set of linear equations using outputs from lu_decomposition() as inputs.
Definition mat.h:1490

The last line may be repeated for any number of b vectors using the same alu and rowp inputs.

Example for finding the inverse of a matrix:

// inputs:
Mat<N, N, T> a; // input matrix
// outputs:
Mat<N, N, T> alu; // result of LU decomposition
Mat<N, N, T> ainv; // result of inversion
Vec<N, size_t> rowp; // result row permutation data for alu
T d; // sign of determinant
...
lu_decomposition(a, &alu, &rowp, &d); // get lu decomposition once
for (size_t i = 0; i < N; ++i) { // find inverse by columns
for (size_t j = 0; j < N; ++j)
b[j] = T(0);
b[i] = T(1);
lu_back_substitution(alu, rowp, b, &b);
ainv.set_col(i, b); // set ainv column
}
void set_col(size_t col, const Vec< vN, T > &v)
Sets the specified column from a vector.
Definition mat.h:746

Example for finding the determinant of a matrix:

// inputs:
Mat<N, N, T> a; // input matrix
// outpus:
Mat<N, N, T> alu; // result of LU decomposition
Vec<N, size_t> rowp; // result row permutation data for alu
T d; // output determinant
lu_decomposition(a, &alu, &rowp, &d);
for (size_t i = 0; i < N; ++i)
d *= alu(i, i);
bool lu_decomposition(const Mat< N, N, T > &a, Mat< N, N, T > *alu, Vec< N, T > *rowp, T *d)
Perform LU decomposition of a square matrix.
Definition mat.h:1414

◆ lu_decomposition()

template<size_t N, typename T>
bool lu_decomposition ( const Mat< N, N, T > & a,
Mat< N, N, T > * alu,
Vec< N, T > * rowp,
T * d )

Perform LU decomposition of a square matrix.

The outputs from this method can further be used for multiple purposes:

  • with lu_back_substitution() to solve a set of linear equations;
  • compute the inverse of the input matrix;
  • compute the determinant of the input matrix.
    Template Parameters
    NThe number of rows and columns in the input matrix.
    TThe scalar type for matrix elements.
    Parameters
    aThe N x N input matrix.
    aluOutput N x N matrix, containing the LU decomposition of a row-wise permutation of a. This may safely be the same location as a (a will be overwritten).
    rowpOutput row permutation data for alu.
    dThe sign of the determinant.
    Returns
    true on success, false if a is a singular matrix.

◆ max() [1/3]

template<typename FT>
FT max ( )

Function returning maximum representable value for a given type.

Template Parameters
FTThe floating point type.
Returns
The maximum representable value.

◆ max() [2/3]

template<typename FT>
std::vector< FT > max ( const Matrix< FT > & A)

Maximum of matrix's column vectors.

◆ max() [3/3]

template<typename FT>
FT max ( const std::vector< FT > & v)

Minimum value of vector.

Maximum value of vector.

◆ max< double >()

template<>
double max< double > ( )
inline

Function returning max for double type numbers.

Returns
The maximum representable value for double.

◆ max< float >()

template<>
float max< float > ( )
inline

Function returning max for float type numbers.

Returns
The maximum representable value for float.

◆ max< int >()

template<>
int max< int > ( )
inline

Function returning max for int type numbers.

Returns
The maximum representable value for int.

◆ mean() [1/2]

template<typename FT>
std::vector< FT > mean ( const Matrix< FT > & A)
inline

Matrix's column vectors mean.

◆ mean() [2/2]

template<typename FT>
FT mean ( const std::vector< FT > & v)
inline

Maximum value of vector.

std::vector's mean.

◆ min() [1/3]

template<typename FT>
FT min ( )

Function returning minimum representable value for a given type.

Template Parameters
FTThe floating point type.
Returns
The minimum representable value.

◆ min() [2/3]

template<typename FT>
std::vector< FT > min ( const Matrix< FT > & A)

Minimum of matrix's column vectors.

◆ min() [3/3]

template<typename FT>
FT min ( const std::vector< FT > & v)

vector sum.

Minimum value of vector.

◆ min< double >()

template<>
double min< double > ( )
inline

Function returning min for double type numbers.

Returns
The minimum representable value for double.

◆ min< float >()

template<>
float min< float > ( )
inline

Function returning min for float type numbers.

Returns
The minimum representable value for float.

◆ min< int >()

template<>
int min< int > ( )
inline

Function returning min for int type numbers.

Returns
The minimum representable value for int.

◆ mix()

template<size_t N, class T>
Vec< N, T > mix ( const Vec< N, T > & v1,
const Vec< N, T > & v2,
T w )

linear interpolation between two vectors (x and y). The return value is computed as (1 − w) * v1 + w * v2.

◆ mult() [1/4]

template<typename FT>
Matrix< FT > mult ( const Matrix< FT > & A,
const Matrix< FT > & B )

This is an optimized version of matrix-matrix multiplication, where the destination matrix has already been allocated.

◆ mult() [2/4]

template<typename FT>
void mult ( const Matrix< FT > & A,
const Matrix< FT > & B,
Matrix< FT > & C )

multiplication

This is an optimized version of matrix-matrix multiplication, where the destination matrix has already been allocated.

◆ mult() [3/4]

template<typename FT>
std::vector< FT > mult ( const Matrix< FT > & A,
const std::vector< FT > & b )

This is an optimized version of matrix-vector multiplication, where the destination vector has already been allocated.

◆ mult() [4/4]

template<typename FT>
void mult ( const Matrix< FT > & A,
const std::vector< FT > & b,
std::vector< FT > & c )

This is an optimized version of matrix-vector multiplication, where the destination vector has already been allocated.

◆ mult_transpose() [1/2]

template<typename FT>
Matrix< FT > mult_transpose ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )

matrix-matrix tranpose multiplication: A * B^T.

◆ mult_transpose() [2/2]

template<typename FT>
Matrix< FT > mult_transpose ( const std::vector< FT > & a,
const std::vector< FT > & b )

vector-vector tranpose multiplication: a * b^T.

◆ next_pow2()

int next_pow2 ( int a)
inline

Calculates the next larger power of 2. If the input is already a power of 2, it will return itself.

Parameters
aThe starting point for finding the next power of 2.
Returns
value^2. Example: next_pow2(50); // returns 64 next_pow2(64); // returns 64 next_pow2(401); // returns 512

◆ norm() [1/3]

template<typename FT>
FT norm ( const Matrix< FT > & A)

utilities

Compute Frobenius norm of matrix.

◆ norm() [2/3]

template<typename FT>
FT norm ( const std::vector< FT > & v)
inline

utilities

std::vector's norm in Euclidean space.

◆ norm() [3/3]

template<typename FT>
FT norm ( const std::vector< std::complex< FT > > & v)

Euclidean norm.

std::vector's norm in Euclidean space.

◆ operator*() [1/12]

template<typename T>
Mat2< T > operator* ( const Mat2< T > & lhs,
const Mat2< T > & rhs )

Specialized matrix-matrix multiplication for 2x2 matrices.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side matrix.
Returns
The result of the multiplication.

◆ operator*() [2/12]

template<typename T>
Vec< 2, T > operator* ( const Mat2< T > & lhs,
const Vec< 2, T > & rhs )

Non-homogeneous, specialized matrix-vector multiplication for 2x2 matrices and 2D vectors.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side vector.
Returns
The result of the multiplication.

◆ operator*() [3/12]

template<typename T>
Mat3< T > operator* ( const Mat3< T > & lhs,
const Mat3< T > & rhs )

Specialized matrix-matrix multiplication for 3x3 matrices.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side matrix.
Returns
The result of the multiplication.

◆ operator*() [4/12]

template<typename T>
Vec< 2, T > operator* ( const Mat3< T > & lhs,
const Vec< 2, T > & rhs )

Specialized matrix-vector multiplication for 3x3 matrices and 2D vectors.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side vector, which is treated as a homogeneous vector (with z = 1).
Returns
The result of the multiplication.

◆ operator*() [5/12]

template<typename T>
Vec< 3, T > operator* ( const Mat3< T > & lhs,
const Vec< 3, T > & rhs )

Non-homogeneous, specialized matrix-vector multiplication for 3x3 matrices and 3D vectors.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side vector.
Returns
The result of the multiplication.

Matrix-vector multiplication for 3x3 matrices and 3D vectors.

◆ operator*() [6/12]

template<typename T>
Mat4< T > operator* ( const Mat4< T > & lhs,
const Mat4< T > & rhs )

Specialized matrix-matrix multiplication for 4x4 matrices.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side matrix.
Returns
The result of the multiplication.

◆ operator*() [7/12]

template<typename T>
Vec< 3, T > operator* ( const Mat4< T > & lhs,
const Vec< 3, T > & rhs )

Specialized matrix-vector multiplication for 4x4 matrices and 3D vectors.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side vector, which is treated as a homogeneous vector (with w = 1).
Returns
The result of the multiplication.

◆ operator*() [8/12]

template<typename T>
Vec< 4, T > operator* ( const Mat4< T > & lhs,
const Vec< 4, T > & rhs )

Non-homogeneous, specialized matrix-vector multiplication for 4x4 matrices and 4D vectors.

Template Parameters
TThe scalar type for matrix elements.
Parameters
lhsThe left-hand side matrix.
rhsThe right-hand side vector.
Returns
The result of the multiplication.

Matrix-vector multiplication for 4x4 matrices and 4D vectors.

◆ operator*() [9/12]

template<typename FT>
Matrix< FT > operator* ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )

matrix-matrix multiplication

◆ operator*() [10/12]

template<typename FT>
std::vector< FT > operator* ( const Matrix< FT > & A,
const std::vector< FT > & b )

matrix-vector multiplication

◆ operator*() [11/12]

template<typename FT>
FT operator* ( const std::vector< FT > & v1,
const std::vector< FT > & v2 )

dot product

Inner product for vectors.

◆ operator*() [12/12]

template<size_t N, size_t M, typename T>
Mat< N, M, T > operator* ( T lhs,
const Mat< N, M, T > & rhs )

Multiplies a scalar by a matrix.

Template Parameters
NThe number of rows in the matrix.
MThe number of columns in the matrix.
TThe scalar type for matrix elements.
Parameters
lhsThe scalar value.
rhsThe matrix.
Returns
The result of the multiplication.

◆ operator+() [1/3]

template<typename FT>
Matrix< FT > operator+ ( const FT & x,
const Matrix< FT > & A )
inline

scalar-matrix addition

◆ operator+() [2/3]

template<typename FT>
Matrix< FT > operator+ ( const Matrix< FT > & A,
const FT & x )
inline

matrix-scalar addition

◆ operator+() [3/3]

template<typename FT>
Matrix< FT > operator+ ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline

matrix-matrix addition

◆ operator-() [1/5]

template<typename FT>
Matrix< FT > operator- ( const FT & x,
const Matrix< FT > & A )
inline

scalar-matrix subtraction

◆ operator-() [2/5]

template<typename FT>
Matrix< FT > operator- ( const Matrix< FT > & A)

arithmetic operators

get negative matrix

◆ operator-() [3/5]

template<typename FT>
Matrix< FT > operator- ( const Matrix< FT > & A,
const FT & x )
inline

matrix-scalar subtraction

◆ operator-() [4/5]

template<typename FT>
Matrix< FT > operator- ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )
inline

matrix-matrix subtraction

◆ operator-() [5/5]

template<typename FT>
std::vector< FT > operator- ( const std::vector< FT > & A)

arithmetic operators

get negative vector

◆ operator<<() [1/7]

template<typename FT>
std::ostream & operator<< ( std::ostream & out,
const Matrix< FT > & A )

input and output

Overload the output stream function.

◆ operator<<() [2/7]

template<typename FT>
std::ostream & operator<< ( std::ostream & out,
const std::vector< FT > & A )

input and output

Output stream support for std::vector<FT>.

◆ operator<<() [3/7]

template<int DIM, typename FT>
std::ostream & operator<< ( std::ostream & os,
const GenericLine< DIM, FT > & line )

Output stream support for GenericLine.

Template Parameters
DIMThe dimension of the line.
FTThe type of the floating-point number.
Parameters
osThe output stream.
lineThe line to output.
Returns
The output stream.

◆ operator<<() [4/7]

std::ostream & operator<< ( std::ostream & os,
Graph::Edge e )
inline

Output stream support for Graph::Edge.

Parameters
osThe output stream.
eThe edge.

◆ operator<<() [5/7]

std::ostream & operator<< ( std::ostream & os,
Graph::Vertex v )
inline

Output stream support for Graph::Vertex.

Parameters
osThe output stream.
vThe vertex.

◆ operator<<() [6/7]

std::ostream & operator<< ( std::ostream & os,
PointCloud::Vertex v )
inline

Output stream support for PointCloud::Vertex.

Parameters
osThe output stream.
vThe vertex to output.
Returns
The output stream.

◆ operator<<() [7/7]

template<size_t N, size_t M, typename T>
std::ostream & operator<< ( std::ostream & output,
const Mat< N, M, T > & m )
inline

Output stream support for Mat.

Template Parameters
NThe number of rows in the matrix.
MThe number of columns in the matrix.
TThe scalar type for matrix elements.
Parameters
outputThe output stream.
mThe matrix to output.
Returns
The output stream.

Output stream support for Mat.

◆ operator>>() [1/3]

template<typename FT>
std::istream & operator>> ( std::istream & in,
Matrix< FT > & A )

Overload the input stream function.

◆ operator>>() [2/3]

template<size_t N, size_t M, typename T>
std::istream & operator>> ( std::istream & input,
Mat< N, M, T > & m )

Input stream support for Mat.

Template Parameters
NThe number of rows in the matrix.
MThe number of columns in the matrix.
TThe scalar type for matrix elements.
Parameters
inputThe input stream.
mThe matrix to input.
Returns
The input stream.

Input stream support for Mat.

◆ operator>>() [3/3]

template<int DIM, typename FT>
std::istream & operator>> ( std::istream & is,
GenericLine< DIM, FT > & line )

Input stream support for GenericLine.

Template Parameters
DIMThe dimension of the line.
FTThe type of the floating-point number.
Parameters
isThe input stream.
lineThe line to input.
Returns
The input stream.

◆ overload() [1/2]

template<typename... Args>
auto overload ( void(* func )(Args...)) -> void (*)(Args...)
inlineconstexpr

Helper function for resolving overloaded non-member functions.

In case of overloading, the pointer to a function does not map to a unique symbol, so the compiler won't be able to pick the right symbol. One way of resolving the right symbol is to explicitly cast the function pointer to the right function type, e.g., static_cast<void (*)(const std::string&, int)>(func), which is a bit heavy syntax. This helper function does just that for a lighter syntax. Example usage:

void foo() {} // function #1
void foo(int) {} // function #2
sig_1.connect(overload<>(&foo)); // sig_1 connects to function #1
sig_2.connect(overload<int>(&foo)); // sig_2 connects to function #2
constexpr auto overload(void(*func)(Args...)) -> void(*)(Args...)
Helper function for resolving overloaded non-member functions.
Definition signal.h:262
See also
overload(void (C::*func)(Args...))

◆ overload() [2/2]

template<typename C, typename... Args>
auto overload ( void(C::* func )(Args...)) -> void (C::*)(Args...)
inlineconstexpr

Helper function for resolving overloaded member functions.

In case of overloading, the pointer to a member function does not map to a unique symbol, so the compiler won't be able to pick the right symbol. One way of resolving the right symbol is to explicitly cast the function pointer to the right function type, e.g., static_cast<void (Viewer::*)(const std::string&, int)>(&Viewer::print), which is a bit heave syntax. This helper function does just that for a lighter syntax. Example usage:

struct foo {
void bar() {} // function #1
void bar(int) {} // function #2
};
sig_1.connect(overload<>(&foo::bar)); // sig_1 connects to function #1
sig_2.connect(overload<int>(&foo::bar)); // sig_2 connects to function #2
See also
overload(void (*func)(Args...))

◆ print_progress()

void print_progress ( float percentage)

A simple progress indicator for console applications.

Parameters
percentageThe progress percentage.

Given percentage = 0.75, the output looks like: 75% [|||||||||||||||||||||||||||||||||||||||||| ]

◆ random()

template<typename FT>
Matrix< FT > random ( int row,
int col )

Generate a matrix with all its elements randomly initialized in the range [0.0, 1.0].

Generate a matrix with its elements in the range [0.0, 1.0].

◆ real()

template<typename FT>
std::vector< FT > real ( const std::vector< std::complex< FT > > & v)

Get angle of a complex vector.

Get real part of a complex vector.

◆ solve_least_squares()

bool solve_least_squares ( const MATRIX & A,
const std::vector< double > & b,
std::vector< double > & x )

Solve a linear system (Ax=b) in the least squares sense.

Parameters
AThe m-by-n (m >= n) coefficient matrix.
bThe right-hand constant vector (m dimensional).
xThe result of the system was successfully solved (m dimensional).
Returns
false if failed. If true, x carries the least-squares solution to the linear system.

◆ sum() [1/2]

template<typename FT>
std::vector< FT > sum ( const Matrix< FT > & A)

Matrix's column vectors sum.

◆ sum() [2/2]

template<typename FT>
FT sum ( const std::vector< FT > & v)

Generates a vector of n points linearly spaced between and including a and b.

std::vector's sum.

◆ svd_decompose()

void svd_decompose ( const MATRIX & A,
MATRIX & U,
MATRIX & S,
MATRIX & V )

Compute the Singular Value Decomposition (SVD) of an M by N matrix. This is a wrapper around Eigen's JacobiSVD.

For an m-by-n matrix A, the singular value decomposition is an m-by-m orthogonal matrix U, an m-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = U*S*V^T.

The singular values, s[k] = S[k][k], are sorted in decreasing order, i.e., sigma[i] >= sigma[i+1] for any i.

The singular value decomposition always exists, so the decomposition will never fail.

Parameters
AThe input matrix to be decomposed, which can have an arbitrary size.
UThe left side M by M orthogonal matrix.
SThe middle M by N diagonal matrix, with zero elements outside its main diagonal.
VThe right side N by N orthogonal matrix V.

Upon return, U, S, and V carry the result of the SVD decomposition.

Attention
V is returned (instead of V^T).

◆ swap() [1/2]

template<typename FT>
void swap ( Matrix< FT > & lhs,
Matrix< FT > & rhs )

Swap two matrices.

◆ swap() [2/2]

template<typename FT>
void swap ( std::vector< FT > & lhs,
std::vector< FT > & rhs )

Euclidean norm.

Swap two vectors.

◆ tensor()

template<size_t M, size_t N, typename T>
Mat< N, M, T > tensor ( const Vec< M, T > & u,
const Vec< N, T > & v )

Returns the tensor product (outer product) of vectors u and v, where u is treated as a column vector and v is treated as a row vector.

Template Parameters
MThe dimension of vector u.
NThe dimension of vector v.
TThe scalar type for vector elements.
Parameters
uThe column vector.
vThe row vector.
Returns
The tensor product of the vectors.

◆ trace() [1/3]

template<size_t D, typename T>
T trace ( const Mat< D, D, T > & m)

Compute the trace of a square matrix.

◆ trace() [2/3]

template<size_t N, typename T>
T trace ( const Mat< N, N, T > & m)

Returns the trace (sum of elements on the main diagonal) of an N x N (square) matrix.

Template Parameters
NThe number of rows and columns in the matrix.
TThe scalar type for matrix elements.
Parameters
mThe matrix.
Returns
The trace of the matrix.

◆ trace() [3/3]

template<typename FT>
FT trace ( const Matrix< FT > & A)

the trace of this matrix, i.e. the sum of the coefficients on the main diagonal. NOTE: the matrix can be any matrix, not necessarily square.

Compute the trace of this matrix, i.e. the sum of the coefficients on the main diagonal. NOTE: the matrix can be any matrix, not necessarily square.

◆ transpose() [1/2]

template<size_t N, size_t M, typename T>
Mat< M, N, T > transpose ( const Mat< N, M, T > & m)

Transposes a matrix.

Template Parameters
NThe number of rows in the matrix.
MThe number of columns in the matrix.
TThe scalar type for matrix elements.
Parameters
mThe matrix to transpose.
Returns
The transposed matrix.

◆ transpose() [2/2]

template<typename FT>
Matrix< FT > transpose ( const Matrix< FT > & A)

transpose and conjugate transpose

matrix transpose

◆ transpose_mult() [1/2]

template<typename FT>
Matrix< FT > transpose_mult ( const Matrix< FT > & A1,
const Matrix< FT > & A2 )

transpose multiplication

matrix-matrix transpose multiplication: A^T * B.

◆ transpose_mult() [2/2]

template<typename FT>
std::vector< FT > transpose_mult ( const Matrix< FT > & A,
const std::vector< FT > & v )

matrix-vector transpose multiplication: A^T * b.