# cvmGet equivalent to c++ [closed]

I need to convert a function from c to c++. The function looks like:

```
// Returns whether H is a nice homography matrix or not
bool niceHomography(const CvMat * H)
{
const double det = cvmGet(H, 0, 0) * cvmGet(H, 1, 1) - cvmGet(H, 1, 0) * cvmGet(H, 0, 1);
if (det < 0)
return false;
//> Some other similar check
return true;
}
```

I thought to do:

```
bool niceHomography(const Mat * H) {
const double det = H->at<float>(0,0) * H ->at<float>(1, 1) - H->at<float>(1, 0) * H->at<float>(0, 1);
if (det < 0)
return false;
}
```

So converting `cvmGet(H,0,0)`

to `H->at<float>(0,0);`

Am I doing it right? Is there any faster option?

Looks like a duplicate of this one http://answers.opencv.org/question/38/what-is-the-most-effective-way-to-access-cvmat/