libroadrunner C API
Functions
rrc_cpp_support.h File Reference

roadRunner C wrappers 2012 More...

#include <vector>
#include "rr-libstruct/lsMatrix.h"
#include "rrRoadRunnerData.h"
#include "rrcStringList.h"
#include "rrArrayList.h"
#include "rrc_types.h"
#include "rrc_exporter.h"

Go to the source code of this file.

Functions

void rrc::setError (const string &err)
 Set wrappers error. More...
 
RoadRunner * rrc::castToRoadRunner (RRHandle rrHandle)
 Cast a handle to RoadRunner instance pointer, throws if it fails. More...
 
bool rrc::copyVector (const RRVector *source, vector< double > &dest)
 Copy a C vector to a std::vector. More...
 
RRVectorrrc::createVector (const vector< double > &vec)
 Creates a C vector from a std::vector. More...
 
RRComplexVectorrrc::createVector (const vector< ls::Complex > &vec)
 Creates a C Complex vector from a std::vector<ls::Complex> More...
 
vector< double > rrc::createVector (const RRVector *vec)
 Creates a std vector from a C vector. More...
 
RRDoubleMatrixrrc::createMatrix (const ls::DoubleMatrix *mat)
 Creates a C matrix from a ls::DoubleMatrix, supplied as a pointer. More...
 
C_DECL_SPEC ls::DoubleMatrix * rrc::createMatrix (const RRDoubleMatrixPtr mat)
 Creates a ls::DoubleMatrix from a RRMatrix, supplied as a pointer. More...
 
RRComplexMatrixrrc::createMatrix (const ls::ComplexMatrix *mat)
 Creates a C complex matrix from a ls::ComplexMatrix, supplied as a pointer. More...
 
RRStringArrayPtr rrc::createList (const rrc::StringList &list)
 Creates a C StringArray from a rr::StringList. More...
 
RRListrrc::createArrayList (const ArrayList &list)
 Creates a heterogenoeus RRList from a rr::ArrayList. More...
 
C_DECL_SPEC RRCDataPtr rrc::createRRCData (const rr::RoadRunner &)
 

Detailed Description

roadRunner C wrappers 2012

Author
Totte Karlsson & Herbert M Sauro

<-----------------------------------------------------------— This file is part of cRoadRunner. See http://code.google.com/p/roadrunnerlib for more details.

Copyright (C) 2012-2013 University of Washington, Seattle, WA, USA

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In plain english this means:

You CAN freely download and use this software, in whole or in part, for personal, company internal, or commercial purposes;

You CAN use the software in packages or distributions that you create.

You SHOULD include a copy of the license in any redistribution you may make;

You are NOT required include the source of software, or of any modifications you may have made to it, in any redistribution you may assemble that includes it.

YOU CANNOT:

redistribute any piece of this software without proper attribution;

Function Documentation

◆ castToRoadRunner()

C_DECL_SPEC rr::RoadRunner * rrc::castToRoadRunner ( RRHandle  rrHandle)

Cast a handle to RoadRunner instance pointer, throws if it fails.

Parameters
[in]handleA handle to a roadrunner instance
Returns
Pointer to a roadrunner instance

◆ copyVector()

C_DECL_SPEC bool rrc::copyVector ( const RRVector source,
vector< double > &  dest 
)

Copy a C vector to a std::vector.

Parameters
[in]sourcePointer to a RRVector structure instance
[in]destDestination std::vector
Returns
True or false, indicating the result

◆ createArrayList()

C_DECL_SPEC RRListPtr rrc::createArrayList ( const ArrayList list)

Creates a heterogenoeus RRList from a rr::ArrayList.

Parameters
[in]listInput Array list
Returns
A handle to a RRList. Null if it fails

◆ createList()

C_DECL_SPEC RRStringArrayPtr rrc::createList ( const rrc::StringList list)

Creates a C StringArray from a rr::StringList.

Parameters
[in]listInput StringList
Returns
A handle to a RRStringArray. Null if it fails

◆ createMatrix() [1/3]

C_DECL_SPEC RRComplexMatrixPtr rrc::createMatrix ( const ls::ComplexMatrix *  mat)

Creates a C complex matrix from a ls::ComplexMatrix, supplied as a pointer.

Parameters
[in]matInput ls::ComplexMatrix
Returns
A handle to a RRComplexMatrix. Null if it fails

◆ createMatrix() [2/3]

C_DECL_SPEC RRDoubleMatrixPtr rrc::createMatrix ( const ls::DoubleMatrix *  mat)

Creates a C matrix from a ls::DoubleMatrix, supplied as a pointer.

Parameters
[in]matInput DoubleMatrix
Returns
A handle to a RRMatrix. Null if it fails

◆ createMatrix() [3/3]

C_DECL_SPEC ls::DoubleMatrix* rrc::createMatrix ( const RRDoubleMatrixPtr  mat)

Creates a ls::DoubleMatrix from a RRMatrix, supplied as a pointer.

Parameters
[in]matInput RRMatrix pointer
Returns
A handle to a DoubleMatrix. Null if it fails

◆ createRRCData()

C_DECL_SPEC RRCDataPtr rrc::createRRCData ( const rr::RoadRunner &  )

Creates an RRCDataPtr from the current state of a RoadRunner object.

This may be used directly after RoadRunner::simulate() has been called to package up the simulation result data and column names into one of these RRCDataPtr structs.

◆ createVector() [1/3]

C_DECL_SPEC vector< double > rrc::createVector ( const RRVector vec)

Creates a std vector from a C vector.

Parameters
[in]vecInput C vector
Returns
A std vector object

◆ createVector() [2/3]

C_DECL_SPEC RRVectorPtr rrc::createVector ( const vector< double > &  vec)

Creates a C vector from a std::vector.

Parameters
[in]vecInput double vector
Returns
A handle to a RRVector. Null if it fails

◆ createVector() [3/3]

C_DECL_SPEC RRComplexVectorPtr rrc::createVector ( const vector< ls::Complex > &  vec)

Creates a C Complex vector from a std::vector<ls::Complex>

Parameters
[in]vecInput Complex vector
Returns
A handle to a RRComplexVector. Null if it fails

◆ setError()

C_DECL_SPEC void rrc::setError ( const string &  err)

Set wrappers error.

Parameters
[in]errorA string containg the error