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

📄 cimpltypes.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 CIMPLETYPES_H
#define CIMPLETYPES_H


#include <complex>

typedef std::complex<double> ComplexDouble;
typedef std::complex<float> ComplexFloat;

#include "cimpl.h"

namespace CIMPL
{


	// type conversion here

	//Vector<double> ToDouble(Vector<float> &m);
	//Matrix<double> ToDouble(Matrix<float> &m);
	//Vector<float> ToFloat(Vector<double> &m);
	//Matrix<float> ToFloat(Matrix<double> &m);

	Vector<ComplexFloat> ToComplexFloat(Vector<float> &m);
	Matrix<ComplexFloat> ToComplexFloat(Matrix<float> &m);

	Vector<ComplexDouble> ToComplexDouble(Vector<double> &m);
	Matrix<ComplexDouble> ToComplexDouble(Matrix<double> &m);
	Vector<ComplexDouble> ToComplexDouble(Vector<ComplexFloat> &m);
	Matrix<ComplexDouble> ToComplexDouble(Matrix<ComplexFloat> &m);


	Vector<ComplexFloat> Complex(Vector<float> &real, Vector<float> &imag);
	Vector<ComplexDouble> Complex(Vector<double> &real, Vector<double> &imag);
	Matrix<ComplexFloat> Complex(Matrix<float> &real, Matrix<float> &imag);
	Matrix<ComplexDouble> Complex(Matrix<double> &real, Matrix<double> &imag);

	//Vector<ComplexFloat> Conj(Vector<ComplexFloat> &c);
	//Vector<ComplexDouble> Conj(Vector<ComplexDouble> &c);
	//Matrix<ComplexFloat> Conj(Matrix<ComplexFloat> &c);
	//Matrix<ComplexDouble> Conj(Matrix<ComplexDouble> &c);


	template <class T, class S>
	Vector<S>& ConvertType(Vector<T>& source, Vector<S>& dest);

	template <class T, class S>
	Matrix<S>& ConvertType(Matrix<T>& source, Matrix<S>& dest);

	template <class T>
	Vector<double> ToDouble(Vector<T> &m);
	template <class T>
	Matrix<double> ToDouble(Matrix<T> &m);
	template <class T>
	Vector<float> ToFloat(Vector<T> &m);
	template <class T>
	Matrix<float> ToFloat(Matrix<T> &m);
	template <class T>
	Vector<int> ToInt(Vector<T> &m);
	template <class T>
	Matrix<int> ToInt(Matrix<T> &m);

	template <class T>
	Matrix<double> ToDouble(Matrix<T> &m);
	template <class T>
	Matrix<float> ToFloat(Matrix<T> &m);
	template <class T>
	Matrix<int> ToInt(Matrix<T> &m);



#include "./CimplTypes.inl"


}; //namespace


#endif


























⌨️ 快捷键说明

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