Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24309 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Jan 29, 2015
1 parent e79e4e4 commit dc4d75b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -357,7 +357,7 @@ template simulationWriteOutputHeaderFile(SimCode simCode ,Text& extraFuncs,Text&
match simCode
case SIMCODE(modelInfo=MODELINFO(__),simulationSettingsOpt = SOME(settings as SIMULATION_SETTINGS(__))) then
let n = numProtectedParamVars(modelInfo)
let outputtype = match settings.outputFormat case "mat" then "MatFileWriter" case "buffer" then "BufferReaderWriter" else "TextFileWriter"
let outputtype = match settings.outputFormat case "mat" then "MatFileWriter" case "buffer" then "BufferReaderWriter" else "TextFileWriter"
let numparams = match settings.outputFormat case "csv" then "1" else n
<<
#pragma once
Expand Down Expand Up @@ -820,7 +820,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
{
_historyImpl->init();


_historyImpl->clear();
}
<%writeoutput(simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)%>
Expand Down Expand Up @@ -5909,7 +5909,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
virtual bool isLinear();
virtual bool isLinearTearing();
virtual bool isConsistent();

>>
//void writeOutput(HistoryImplType::value_type_v& v ,vector<string>& head ,const IMixedSystem::OUTPUT command = IMixedSystem::UNDEF_OUTPUT);
end generateAlgloopMethodDeclarationCode;
Expand Down Expand Up @@ -13134,8 +13134,8 @@ case _ then
let indexColumn = (jacobianColumn |> (eqs,vars,indxColumn) =>
indxColumn
;separator="\n")


let jacvals = ( sparsepattern |> (cref,indexes) hasindex index0 =>
let jaccol = ( indexes |> i_index hasindex index1 =>
(match indexColumn case "1" then '_<%matrixName%>jacobian(<%crefWithoutIndexOperator(cref)%>$pDER<%matrixName%>$indexdiff,0) = _<%matrixName%>jac_y(0);/*test1<%index0%>,<%index1%>*/'
Expand All @@ -13154,7 +13154,7 @@ _<%matrixName%>jac_x.clear();

void <%classname%>Jacobian::get<%matrixName%>Jacobian(SparseMatrix& matrix)
{

<%jacvals%>
matrix = _<%matrixName%>jacobian;
}
Expand Down
16 changes: 8 additions & 8 deletions Compiler/Util/StringUtil.mo
Expand Up @@ -163,21 +163,21 @@ public function wordWrap
so that words are not split. It also wraps the string at any newline
characters it finds. The function also takes two optional parameters to set
the delimiter and raggedness.

inDelimiter sets the delimiter which is prefixed to all lines except for the
first one. The length of this delimiter is taken into account when wrapping
the string, so it must be shorter than the wrap length. Otherwise the string
will be returned unwrapped. The default is an empty string.

inRaggedness determines the allowed raggedness of the lines, given as a ratio
between 0 and 1. A raggedness of e.g. 0.2 means that each segment may be at
most 20% smaller than the max line length. If a line would be shorter than
this, due to a long word, then the function instead hyphenates the last word.
This is not done according to any grammatical rules, the words are just
broken so that the line is as long as allowed. The default is 0.3.

This function operates on ASCII strings, and does not handle UTF-8 strings
correctly."
correctly."
input String inString;
input Integer inWrapLength;
input String inDelimiter := "";
Expand Down Expand Up @@ -212,7 +212,7 @@ algorithm
if next_char <> CHAR_SPACE and next_char <> CHAR_DASH then
// If the next character isn't a space or dash, search backwards for a space.
pos := rfindChar(line, CHAR_SPACE, end_pos, end_pos - gap_size);

if pos <> NO_POS then
// A space was found, break the string here.
str := substring(line, start_pos, pos - 1);
Expand All @@ -223,7 +223,7 @@ algorithm

if pos > 1 then
// A dash was found, check that the previous character is alphabetic.
char := stringGetNoBoundsChecking(line, pos - 1);
char := stringGetNoBoundsChecking(line, pos - 1);
pos := if isAlpha(char) and isAlpha(next_char) then pos else NO_POS;
end if;

Expand All @@ -249,7 +249,7 @@ algorithm
end_pos := start_pos + line_len;
delim := inDelimiter;
end while;

// Add any remainder of the line to the list.
if start_pos < stringLength(line) then
str := delim + substring(line, start_pos, stringLength(line));
Expand All @@ -260,7 +260,7 @@ algorithm
start_pos := 1;
end_pos := line_len;
delim := inDelimiter;
end for;
end for;

outStrings := listReverseInPlace(outStrings);
end wordWrap;
Expand Down
Expand Up @@ -105,7 +105,7 @@ void SolverDefaultImplementation::initialize()
// Set current start time to the system
timeevent_system->setTime(_tCurrent);


if(_settings->getGlobalSettings()->getOutputPointType() != EMPTY2 && _settings->getGlobalSettings()->getOutputFormat() != EMPTY)
writeoutput_system->writeOutput(IWriteOutput::HEAD_LINE);

Expand Down
Expand Up @@ -92,7 +92,7 @@ void AlgLoopDefaultImplementation::initialize()
/// Output routine (to be called by the solver after every successful integration step)
void AlgLoopDefaultImplementation::writeOutput(const OUTPUT command )
{

};

/*
Expand Down
Expand Up @@ -82,7 +82,7 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>

void read(ublas::matrix<double>& R)
{

ublas::matrix<double>::size_type m = size();
ublas::matrix<double>::size_type n = _var_outputs.size();
ublas::matrix<double>::size_type i,i2=0,j;
Expand Down Expand Up @@ -112,7 +112,7 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
cout<<"read from variables buffer faild" << std::endl;
throw ex;
}


}

Expand Down Expand Up @@ -170,7 +170,7 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
{
_var_outputs =s_list;
}

/*
writes simulation results for a time step
@v_list variables and state vars
Expand All @@ -179,8 +179,8 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
*/
void write(typename Writer<dim_1, dim_2, dim_3, dim_4>::value_type_v& v_list, typename Writer<dim_1, dim_2, dim_3, dim_4>::value_type_dv& v2_list, double time)
{


try
{
std::pair<std::map<double, unsigned long>::iterator,bool> p;
Expand All @@ -194,8 +194,8 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
{
_buffer_pos++;
}


_variables_buffer.push_back(v_list);
_derivatives_buffer.push_back(v2_list);
}
Expand All @@ -208,7 +208,7 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
// textwriter->write(v,v2, time);
}


void getTime(vector<double>& time)
{
try
Expand Down Expand Up @@ -249,11 +249,11 @@ class BufferReaderWriter : public Writer<dim_1, dim_2, dim_3, dim_4>
//textwriter->eraseAll();
}


protected:
typedef boost::circular_buffer< typename Writer<dim_1, dim_2, dim_3, dim_4>::value_type_v > buffer_type_v;
typedef boost::circular_buffer< typename Writer<dim_1, dim_2, dim_3, dim_4>::value_type_dv > buffer_type_d;

typedef std::map<double,unsigned long> _time_entries_type;
buffer_type_v _variables_buffer;
buffer_type_d _derivatives_buffer;
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Include/Core/HistoryImpl.h
Expand Up @@ -26,7 +26,7 @@ class HistoryImpl : public IHistory,
_var_outputs=var_outputs;
}
*/

void init()
{
ResultsPolicy<dim_1,dim_2,dim_3,dim_4>::init(_globalSettings.getOutputPath(), _globalSettings.getResultsFileName());
Expand Down Expand Up @@ -95,6 +95,6 @@ class HistoryImpl : public IHistory,
private:
//map of indices of all output variables
//map<unsigned int,string> _var_outputs;

IGlobalSettings& _globalSettings;
};
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Include/Core/Modelica.h
Expand Up @@ -193,7 +193,7 @@ typedef boost::function<void (unordered_map<string,unsigned int>&,unordered_map<
#include <Core/DataExchange/SimDouble.h>
#endif
/*
template class StatArrayDim1<double, 3>;
template class StatArrayDim1<double, 4> ;
template class StatArrayDim2<double, 3,3> ;
Expand All @@ -207,5 +207,5 @@ typedef boost::function<void (unordered_map<string,unsigned int>&,unordered_map<
template class boost::unordered_map<bool*, bool>;
template class boost::circular_buffer<double>;
template class map<unsigned int, boost::circular_buffer<double> >;
template class map<unsigned int,string>
template class map<unsigned int,string>
*/
Expand Up @@ -88,5 +88,5 @@ class BOOST_EXTENSION_ALGLOOPDEFAULTIMPL_DECL AlgLoopDefaultImplementation

IAlgLoop::CONSTRTYPE
_constraintType; ///< Typ der Bindungsgleichungen (analog, digital, binär)

};

0 comments on commit dc4d75b

Please sign in to comment.