⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.h

📁 图像分割算法
💻 H
字号:
//Copyright (c) 2004-2005, Baris Sumengen
//All rights reserved.
//
// CIMPL Matrix Performance Library
//
//Redistribution and use in source and binary
//forms, with or without modification, are
//permitted provided that the following
//conditions are met:
//
//    * No commercial use is allowed. 
//    This software can only be used
//    for non-commercial purposes. This 
//    distribution is mainly intended for
//    academic research and teaching.
//    * Redistributions of source code must
//    retain the above copyright notice, this
//    list of conditions and the following
//    disclaimer.
//    * Redistributions of binary form must
//    mention the above copyright notice, this
//    list of conditions and the following
//    disclaimer in a clearly visible part 
//    in associated product manual, 
//    readme, and web site of the redistributed 
//    software.
//    * Redistributions in binary form must
//    reproduce the above copyright notice,
//    this list of conditions and the
//    following disclaimer in the
//    documentation and/or other materials
//    provided with the distribution.
//    * The name of Baris Sumengen may not be
//    used to endorse or promote products
//    derived from this software without
//    specific prior written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
//HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
//NOT LIMITED TO, THE IMPLIED WARRANTIES OF
//MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//CONTRIBUTORS BE LIABLE FOR ANY
//DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
//EXEMPLARY, OR CONSEQUENTIAL DAMAGES
//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
//OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
//HOWEVER CAUSED AND ON ANY THEORY OF
//LIABILITY, WHETHER IN CONTRACT, STRICT
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
//OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
//OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//POSSIBILITY OF SUCH DAMAGE.

#pragma once
#ifndef MATHCORE_FUNCTIONS_H
#define MATHCORE_FUNCTIONS_H

#include "cimpl.h"
using namespace CIMPL;


namespace MathCore
{

// Inverts elements
	Vector<float> Inv(Vector<float>& m);
	Vector<double> Inv(Vector<double>& m);
	Matrix<float> Inv(Matrix<float>& m);
	Matrix<double> Inv(Matrix<double>& m);
	
	Vector<float>&  InvI(Vector<float>& m);
	Vector<double>& InvI(Vector<double>& m);
	Matrix<float>&  InvI(Matrix<float>& m);
	Matrix<double>& InvI(Matrix<double>& m);

// Division of elements
	Vector<float> Div(Vector<float>& m1, Vector<float>& m2);
	Vector<double> Div(Vector<double>& m1, Vector<double>& m2);
	Matrix<float> Div(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double> Div(Matrix<double>& m1, Matrix<double>& m2);

	Vector<float>&  DivI(Vector<float>& m1, Vector<float>& m2);
	Vector<double>& DivI(Vector<double>& m1, Vector<double>& m2);
	Matrix<float>&  DivI(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double>& DivI(Matrix<double>& m1, Matrix<double>& m2);

// Square root of elements
	Vector<float> Sqrt(Vector<float>& m);
	Vector<double> Sqrt(Vector<double>& m);
	Matrix<float> Sqrt(Matrix<float>& m);
	Matrix<double> Sqrt(Matrix<double>& m);
	
	Vector<float>&  SqrtI(Vector<float>& m);
	Vector<double>& SqrtI(Vector<double>& m);
	Matrix<float>&  SqrtI(Matrix<float>& m);
	Matrix<double>& SqrtI(Matrix<double>& m);

// Inverse Square root of elements
	Vector<float> InvSqrt(Vector<float>& m);
	Vector<double> InvSqrt(Vector<double>& m);
	Matrix<float> InvSqrt(Matrix<float>& m);
	Matrix<double> InvSqrt(Matrix<double>& m);
	
	Vector<float>&  InvSqrtI(Vector<float>& m);
	Vector<double>& InvSqrtI(Vector<double>& m);
	Matrix<float>&  InvSqrtI(Matrix<float>& m);
	Matrix<double>& InvSqrtI(Matrix<double>& m);

// Cube root of elements
	Vector<float> Cbrt(Vector<float>& m);
	Vector<double> Cbrt(Vector<double>& m);
	Matrix<float> Cbrt(Matrix<float>& m);
	Matrix<double> Cbrt(Matrix<double>& m);
	
	Vector<float>&  CbrtI(Vector<float>& m);
	Vector<double>& CbrtI(Vector<double>& m);
	Matrix<float>&  CbrtI(Matrix<float>& m);
	Matrix<double>& CbrtI(Matrix<double>& m);

// Cube root of elements
	Vector<float> InvCbrt(Vector<float>& m);
	Vector<double> InvCbrt(Vector<double>& m);
	Matrix<float> InvCbrt(Matrix<float>& m);
	Matrix<double> InvCbrt(Matrix<double>& m);
	
	Vector<float>&  InvCbrtI(Vector<float>& m);
	Vector<double>& InvCbrtI(Vector<double>& m);
	Matrix<float>&  InvCbrtI(Matrix<float>& m);
	Matrix<double>& InvCbrtI(Matrix<double>& m);

// Pow of elements
	Vector<float> Pow(Vector<float>& m1, Vector<float>& m2);
	Vector<double> Pow(Vector<double>& m1, Vector<double>& m2);
	Matrix<float> Pow(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double> Pow(Matrix<double>& m1, Matrix<double>& m2);

	Vector<float>&  PowI(Vector<float>& m1, Vector<float>& m2);
	Vector<double>& PowI(Vector<double>& m1, Vector<double>& m2);
	Matrix<float>&  PowI(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double>& PowI(Matrix<double>& m1, Matrix<double>& m2);

// Pow of vector elements to a constant
	Vector<float> Powx(Vector<float>& m1, const float m2);
	Vector<double> Powx(Vector<double>& m1, const double m2);
	Matrix<float> Powx(Matrix<float>& m1, const float m2);
	Matrix<double> Powx(Matrix<double>& m1, const double m2);

	Vector<float>&  PowxI(Vector<float>& m1, const float m2);
	Vector<double>& PowxI(Vector<double>& m1, const double m2);
	Matrix<float>&  PowxI(Matrix<float>& m1, const float m2);
	Matrix<double>& PowxI(Matrix<double>& m1, const double m2);



// Exponent of elements
	Vector<float> Exp(Vector<float>& m);
	Vector<double> Exp(Vector<double>& m);
	Matrix<float> Exp(Matrix<float>& m);
	Matrix<double> Exp(Matrix<double>& m);
	
	Vector<float>&  ExpI(Vector<float>& m);
	Vector<double>& ExpI(Vector<double>& m);
	Matrix<float>&  ExpI(Matrix<float>& m);
	Matrix<double>& ExpI(Matrix<double>& m);


// Ln of elements
	Vector<float> Ln(Vector<float>& m);
	Vector<double> Ln(Vector<double>& m);
	Matrix<float> Ln(Matrix<float>& m);
	Matrix<double> Ln(Matrix<double>& m);
	
	Vector<float>&  LnI(Vector<float>& m);
	Vector<double>& LnI(Vector<double>& m);
	Matrix<float>&  LnI(Matrix<float>& m);
	Matrix<double>& LnI(Matrix<double>& m);

// Log10 of elements
	Vector<float> Log10(Vector<float>& m);
	Vector<double> Log10(Vector<double>& m);
	Matrix<float> Log10(Matrix<float>& m);
	Matrix<double> Log10(Matrix<double>& m);
	
	Vector<float>&  Log10I(Vector<float>& m);
	Vector<double>& Log10I(Vector<double>& m);
	Matrix<float>&  Log10I(Matrix<float>& m);
	Matrix<double>& Log10I(Matrix<double>& m);


// Cos of elements
	Vector<float> Cos(Vector<float>& m);
	Vector<double> Cos(Vector<double>& m);
	Matrix<float> Cos(Matrix<float>& m);
	Matrix<double> Cos(Matrix<double>& m);
	
	Vector<float>&  CosI(Vector<float>& m);
	Vector<double>& CosI(Vector<double>& m);
	Matrix<float>&  CosI(Matrix<float>& m);
	Matrix<double>& CosI(Matrix<double>& m);

// Sin of elements
	Vector<float> Sin(Vector<float>& m);
	Vector<double> Sin(Vector<double>& m);
	Matrix<float> Sin(Matrix<float>& m);
	Matrix<double> Sin(Matrix<double>& m);
	
	Vector<float>&  SinI(Vector<float>& m);
	Vector<double>& SinI(Vector<double>& m);
	Matrix<float>&  SinI(Matrix<float>& m);
	Matrix<double>& SinI(Matrix<double>& m);

// Tan of elements
	Vector<float> Tan(Vector<float>& m);
	Vector<double> Tan(Vector<double>& m);
	Matrix<float> Tan(Matrix<float>& m);
	Matrix<double> Tan(Matrix<double>& m);
	
	Vector<float>&  TanI(Vector<float>& m);
	Vector<double>& TanI(Vector<double>& m);
	Matrix<float>&  TanI(Matrix<float>& m);
	Matrix<double>& TanI(Matrix<double>& m);

// Acos of elements
	Vector<float> Acos(Vector<float>& m);
	Vector<double> Acos(Vector<double>& m);
	Matrix<float> Acos(Matrix<float>& m);
	Matrix<double> Acos(Matrix<double>& m);
	
	Vector<float>&  AcosI(Vector<float>& m);
	Vector<double>& AcosI(Vector<double>& m);
	Matrix<float>&  AcosI(Matrix<float>& m);
	Matrix<double>& AcosI(Matrix<double>& m);

// Asin of elements
	Vector<float> Asin(Vector<float>& m);
	Vector<double> Asin(Vector<double>& m);
	Matrix<float> Asin(Matrix<float>& m);
	Matrix<double> Asin(Matrix<double>& m);
	
	Vector<float>&  AsinI(Vector<float>& m);
	Vector<double>& AsinI(Vector<double>& m);
	Matrix<float>&  AsinI(Matrix<float>& m);
	Matrix<double>& AsinI(Matrix<double>& m);

// Atan of elements
	Vector<float> Atan(Vector<float>& m);
	Vector<double> Atan(Vector<double>& m);
	Matrix<float> Atan(Matrix<float>& m);
	Matrix<double> Atan(Matrix<double>& m);
	
	Vector<float>&  AtanI(Vector<float>& m);
	Vector<double>& AtanI(Vector<double>& m);
	Matrix<float>&  AtanI(Matrix<float>& m);
	Matrix<double>& AtanI(Matrix<double>& m);

// Atan2 of elements
	Vector<float> Atan2(Vector<float>& m1, Vector<float>& m2);
	Vector<double> Atan2(Vector<double>& m1, Vector<double>& m2);
	Matrix<float> Atan2(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double> Atan2(Matrix<double>& m1, Matrix<double>& m2);

	Vector<float>&  Atan2I(Vector<float>& m1, Vector<float>& m2);
	Vector<double>& Atan2I(Vector<double>& m1, Vector<double>& m2);
	Matrix<float>&  Atan2I(Matrix<float>& m1, Matrix<float>& m2);
	Matrix<double>& Atan2I(Matrix<double>& m1, Matrix<double>& m2);



// Cosh of elements
	Vector<float> Cosh(Vector<float>& m);
	Vector<double> Cosh(Vector<double>& m);
	Matrix<float> Cosh(Matrix<float>& m);
	Matrix<double> Cosh(Matrix<double>& m);
	
	Vector<float>&  CoshI(Vector<float>& m);
	Vector<double>& CoshI(Vector<double>& m);
	Matrix<float>&  CoshI(Matrix<float>& m);
	Matrix<double>& CoshI(Matrix<double>& m);

// Sinh of elements
	Vector<float> Sinh(Vector<float>& m);
	Vector<double> Sinh(Vector<double>& m);
	Matrix<float> Sinh(Matrix<float>& m);
	Matrix<double> Sinh(Matrix<double>& m);
	
	Vector<float>&  SinhI(Vector<float>& m);
	Vector<double>& SinhI(Vector<double>& m);
	Matrix<float>&  SinhI(Matrix<float>& m);
	Matrix<double>& SinhI(Matrix<double>& m);

// Tanh of elements
	Vector<float> Tanh(Vector<float>& m);
	Vector<double> Tanh(Vector<double>& m);
	Matrix<float> Tanh(Matrix<float>& m);
	Matrix<double> Tanh(Matrix<double>& m);
	
	Vector<float>&  TanhI(Vector<float>& m);
	Vector<double>& TanhI(Vector<double>& m);
	Matrix<float>&  TanhI(Matrix<float>& m);
	Matrix<double>& TanhI(Matrix<double>& m);

// Acosh of elements
	Vector<float> Acosh(Vector<float>& m);
	Vector<double> Acosh(Vector<double>& m);
	Matrix<float> Acosh(Matrix<float>& m);
	Matrix<double> Acosh(Matrix<double>& m);
	
	Vector<float>&  AcoshI(Vector<float>& m);
	Vector<double>& AcoshI(Vector<double>& m);
	Matrix<float>&  AcoshI(Matrix<float>& m);
	Matrix<double>& AcoshI(Matrix<double>& m);

// Asinh of elements
	Vector<float> Asinh(Vector<float>& m);
	Vector<double> Asinh(Vector<double>& m);
	Matrix<float> Asinh(Matrix<float>& m);
	Matrix<double> Asinh(Matrix<double>& m);
	
	Vector<float>&  AsinhI(Vector<float>& m);
	Vector<double>& AsinhI(Vector<double>& m);
	Matrix<float>&  AsinhI(Matrix<float>& m);
	Matrix<double>& AsinhI(Matrix<double>& m);

// Atanh of elements
	Vector<float> Atanh(Vector<float>& m);
	Vector<double> Atanh(Vector<double>& m);
	Matrix<float> Atanh(Matrix<float>& m);
	Matrix<double> Atanh(Matrix<double>& m);
	
	Vector<float>&  AtanhI(Vector<float>& m);
	Vector<double>& AtanhI(Vector<double>& m);
	Matrix<float>&  AtanhI(Matrix<float>& m);
	Matrix<double>& AtanhI(Matrix<double>& m);


// Erf of elements
	Vector<float> Erf(Vector<float>& m);
	Vector<double> Erf(Vector<double>& m);
	Matrix<float> Erf(Matrix<float>& m);
	Matrix<double> Erf(Matrix<double>& m);
	
	Vector<float>&  ErfI(Vector<float>& m);
	Vector<double>& ErfI(Vector<double>& m);
	Matrix<float>&  ErfI(Matrix<float>& m);
	Matrix<double>& ErfI(Matrix<double>& m);

// Erfc of elements
	Vector<float> Erfc(Vector<float>& m);
	Vector<double> Erfc(Vector<double>& m);
	Matrix<float> Erfc(Matrix<float>& m);
	Matrix<double> Erfc(Matrix<double>& m);
	
	Vector<float>&  ErfcI(Vector<float>& m);
	Vector<double>& ErfcI(Vector<double>& m);
	Matrix<float>&  ErfcI(Matrix<float>& m);
	Matrix<double>& ErfcI(Matrix<double>& m);




};





#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -