c++ - Can someone explain this code for me please? -


I am trying to understand what is the comparison of an Ieterter?: Can anyone please explain in the code given below is? Thanks in advance

  Maps & lt; String, cvsvm & gt; Classes_classifiers = predictor.getClassesClassifiers (); Map & LT; String, the map & lt; String, integer & gt; & Gt; confusion matrix; (Map  CvSVM> gt; :: iterator = class_classifiers.begin (); it! = Classes_classifiers.end (); ++ this) {for (string, cvsvm> gt; :: iterator it1 = classes_classifiers Begin;); It1! = Classes_classifiers.end (); ++ it1) {string class1 = ((* this) .first.compare ("Foods") == 0)? "People": (* this). First; String Class 2 = ((* it1) .first.compare ("Foods") == 0)? "People": (* it1). First; Illusion _matrix [class 1] [class 2] = 0; }}  

This can be written in a less vague way

  it-> ago == "Foods"? "People": this-> first; Since   

returns string :: comparison if string is equal to logic.

it-> first is the key from the key-value pair in which the iterator is mentioned, this key returns, but it changes to "people" Is, if it was "Foods" .


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -