Skip to content

Commit

Permalink
make function return void
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jul 17, 2011
1 parent 4d12457 commit 3de2daa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions src/libshogun/kernel/WeightedDegreePositionStringKernel.cpp
Expand Up @@ -925,29 +925,21 @@ bool CWeightedDegreePositionStringKernel::set_weights(SGMatrix<float64_t> new_we
return true;
}

bool CWeightedDegreePositionStringKernel::set_position_weights(SGVector<float64_t> pws)
void CWeightedDegreePositionStringKernel::set_position_weights(SGVector<float64_t> pws)
{
if (seq_length==0)
seq_length=pws.vlen;

if (seq_length!=pws.vlen)
{
SG_ERROR("seq_length = %i, position_weights_length=%i\n", seq_length, pws.vlen);
return false;
}

delete[] position_weights;
position_weights=new float64_t[pws.vlen];
position_weights_len=pws.vlen;
tries.set_position_weights(position_weights);

if (position_weights)
{
for (int32_t i=0; i<pws.vlen; i++)
position_weights[i]=pws.vector[i];
return true;
}
else
return false;
for (int32_t i=0; i<pws.vlen; i++)
position_weights[i]=pws.vector[i];
}

bool CWeightedDegreePositionStringKernel::set_position_weights_lhs(float64_t* pws, int32_t len, int32_t num)
Expand Down
2 changes: 1 addition & 1 deletion src/libshogun/kernel/WeightedDegreePositionStringKernel.h
Expand Up @@ -392,7 +392,7 @@ class CWeightedDegreePositionStringKernel: public CStringKernel<char>
* @param pws new position weights
* @return if setting was successful
*/
virtual bool set_position_weights(SGVector<float64_t> pws);
virtual void set_position_weights(SGVector<float64_t> pws);

/** set position weights for left-hand side
*
Expand Down

0 comments on commit 3de2daa

Please sign in to comment.