Sunday, February 13, 2011

Algorithm to check the cross of the matrix

Algorithm to check the cross of the matrix using
where  m_matrix is an object of the IVSFlexGrid wrapper.
for (int i = 2; i < pGrid->GetRows(); ++i)
{
   if ( dLamount[i] > 0 && dHamount[i-1] > 0 )
   {
     double dAmountDifference = 0.0 ;
     damountDifference = dLamount[i] - dHamount[i-1];

      if ( damountDifference > 1 )
     {
        CString strMessage;
         strMessage.Format("Difference in the amount", damountDifference );

      if (IDYES == ::MessageBox(GetSafeHwnd(), strMessage, "", MB_ICONINFORMATION MB_YESNO))
      {
               return true;
}
else
{
     return false;
}
}
}
}
 
More Algorithms :
 
/*--------------------------------------------------------------------------------------

Function Name : GetPercentageValue()
Return Type : double
Usage : Function to get 2 Digits Precision;
without rounding it off. As per reqirement of Percentage value.
Author : Nikki
----------------------------------------------------------------------------------------*/

double CCustomRatingCompMatrix::GetPercentageValue( double x)
{
    double f, xi, xf;
    xf = modf( x, &xi );
    f = floor(xf *100+0.0)/100.0;
    return xi + f;
}

/*---------------------------------------------------------------------
Function Name : GetItemCount_PointEarnedValue()
Return Type : int
Usage : Get the ItemCount and PointEarn values
without rounding it off. As per reqirement of Percentage value.
Author :
-----------------------------------------------------------------------*/

int CMatrix::GetItemCount_PointEarnedValue(double x)
{
            return floor(((double)x*100))/100;
}


No comments:

Post a Comment

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...