libSBML C API  libSBML 5.20.4 C API
Loading...
Searching...
No Matches
promoteParameters.c

Promote all local parameters in the model to global parameters.

Promote all local parameters in the model to global parameters.

/**
* @file promoteParameters.c
* @brief promotes all local to global paramters
* @author Frank T. Bergmann
*
* <!--------------------------------------------------------------------------
* This sample program is distributed under a different license than the rest
* of libSBML. This program uses the open-source MIT license, as follows:
*
* Copyright (c) 2013-2018 by the California Institute of Technology
* (California, USA), the European Bioinformatics Institute (EMBL-EBI, UK)
* and the University of Heidelberg (Germany), with support from the National
* Institutes of Health (USA) under grant R01GM070923. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Neither the name of the California Institute of Technology (Caltech), nor
* of the European Bioinformatics Institute (EMBL-EBI), nor of the University
* of Heidelberg, nor the names of any contributors, may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* ------------------------------------------------------------------------ -->
*/
#include <stdio.h>
#include <sbml/SBMLTypes.h>
int
main (int argc, char *argv[])
{
if (argc != 3)
{
printf("Usage: promoteParameters input-filename output-filename\n");
return 2;
}
doc = readSBML(argv[1]);
{
}
else
{
/* need new variables ... */
/* create a new conversion properties structure */
/* add an option that we want to convert parameters */
option1 = ConversionOption_create("promoteLocalParameters");
ConversionOption_setValue(option1, "true");
ConversionOption_setDescription(option1, "Promotes all Local Parameters to Global ones");
/* perform the conversion */
{
printf ("conversion failed ... ");
return 3;
}
/* successfully completed, write the resulting file */
writeSBML(doc, argv[2]);
}
return 0;
}
@ CNV_TYPE_BOOL
Definition ConversionOption.h:146
ConversionOption_t * ConversionOption_create(const char *key)
_tCreates_t _ta_t _tnew_t _tConversionOption_t_t _twith_t _tthe_t _tgiven_t _tkey_t.
void ConversionOption_free(ConversionOption_t *co)
_tDestroys_t _tthis_t _tConversionOption_t_t.
void ConversionOption_setDescription(ConversionOption_t *co, const char *description)
_tSets_t _tthe_t _tdescription_t _tfor_t _tthe_t _toption_t.
void ConversionOption_setValue(ConversionOption_t *co, const char *value)
_tSets_t _tthe_t _tvalue_t _tfor_t _tthe_t _toption_t.
void ConversionOption_setType(ConversionOption_t *co, ConversionOptionType_t type)
_tSets_t _tthe_t _ttype_t _tfor_t _tthe_t _toption_t.
Definition of ConversionProperties_t, the class encapsulating conversion configuration.
ConversionProperties_t * ConversionProperties_create()
_tCreates_t _ta_t _tnew_t _tconversion_t _tproperties_t _tstructure_t (_twithout_t _tnamespace_t)
void ConversionProperties_free(ConversionProperties_t *cp)
_tDestroys_t _tthis_t _tconversion_t _tproperties_t _tstructure_t
void ConversionProperties_addOption(ConversionProperties_t *cp, const ConversionOption_t *option)
_tAdds_t _ta_t _tcopy_t _tof_t _tthe_t _tgiven_t _tConversionOption_t_t _tstructure_t _tto_t _tthe_t ...
void SBMLDocument_printErrors(SBMLDocument_t *d, FILE *stream)
_tPrints_t _tto_t _tthe_t _tgiven_t _toutput_t _tstream_t _tall_t _tthe_t _terrors_t _tor_t _twarning...
Definition SBMLDocument.cpp:2525
unsigned int SBMLDocument_getNumErrorsWithSeverity(const SBMLDocument_t *d, unsigned int severity)
_tReturns_t _tthe_t _tnumber_t _tof_t _terrors_t _tor_t _twarnings_t _tencountered_t _tduring_t _tpar...
Definition SBMLDocument.cpp:2517
void SBMLDocument_free(SBMLDocument_t *d)
_tFrees_t _tthe_t _tgiven_t _tSBMLDocument_t_t _tstructure_t.
Definition SBMLDocument.cpp:2248
int SBMLDocument_convert(SBMLDocument_t *d, const ConversionProperties_t *props)
_tConverts_t _tthis_t _tdocument_t _tusing_t _tthe_t _tconverter_t _tthat_t _tbest_t _tmatches_t _tth...
Definition SBMLDocument.cpp:2614
SBMLDocument_t * readSBML(const char *filename)
@_tcopydoc_t _tdoc_readsbmlfromfile_t
Definition SBMLReader.cpp:446
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
_tWrites_t _tthe_t _tgiven_t _tSBML_t _tdocument_t @_tp_t _td_t _tto_t _tthe_t _tfile_t _tnamed_t _tb...
Definition SBMLWriter.cpp:440
@ LIBSBML_SEV_ERROR
Definition XMLError.h:534
@ LIBSBML_OPERATION_SUCCESS
Definition operationReturnValues.h:61