Dreaming = Thinking,

however:

Thinking ≠ Dreaming.

Whilst dreaming always requires thinking on some level it may not necessarily be cognitive. However, thinking happens in physical reality regardless or whether or not one is dreaming. Thus thinking does not always mean one is dreaming, simplified one can say:

Thinking does not equal (≠) Dreaming.


So it may be you were either cognitively thinking, or dreaming and thinking cognitively.