### Ratio check function with findHomography

i need to acquire a perspective matrix from two images taken by the same camera after its movement in a 3D space...I'm taking inspiration from this OpenCV's example about the use of findHomography.
I would like to substitute the "filter for the good_matches there suggested with the "ratio check function":

~~ ~~class RatioCheck
~~ {
~~{
public:
RatioCheck(){};
void filter(vector<vector<DMatch>>& nmatches, double RatioT);
~~ ~~};
~~ ~~void RatioCheck::filter(std::vector<vector<DMatch> > &nmatches, double RatioT=0.8)
~~ {
~~{
vector<vector<DMatch>> knmatches;
for(int i=0; i<nmatches.size(); i++)
~~{
~~ {
if((nmatches[i].size()==1)||...
(abs(nmatches[i][0].distance/nmatches[i][1].distance) <RatioT))
~~{
~~ {
knmatches.push_back(nmatches[i]);
}
}
nmatches=knmatches;
~~ ~~}

In principle i have to give to the function a ~~vector<vector<dmatch> > ~~`vector<vector<DMatch> >`

..but actually i have a ~~vector<dmatch>...does ~~`vector<DMatch>`

... does anybody know how?