Reducing memory footprint with queue of classes
As @Lstor mentions in the comments, clean up your formatting and indentation.  There should be plenty of resources online, and you can also look at other highly-developed code for ideas.  Above all, keep it clear and consistent.

Naming


This isn't a very descriptive typedef:

typedef vector&lt;double&gt; Vec;


There's no point in using a typedef here if you're just going to name it what it already it.  Name it based on how this type is used in your program, otherwise don't bother renaming it.
Why is this all uppercase?

typedef queue&lt; Subcube&gt;  SUBQUEUE;


It's a type, not a macro.  Just like you have with Vec, have it start with an uppercase, but don't use all uppercase.


Functions


I'm not sure what this is:

for(int j=0;j&lt;n;j++)
{
    nw.e.at(j) = f.e.at(j) +(f.hside/2)*v.at(j);
    }
  }


For one thing, the second closing curly brace is for the function.  But the poor indentation makes it appear to belong to the loop.

Put some whitespace between the operators and operands within the loop statement.  This should be done everywhere for clarity.

Consider adding comments explaining what the loop is doing.  I'm not even sure what is going on inside.  Even if something seems obvious to you, it won't be obvious for everyone.  Now, if something is too obvious, then it doesn't warrant commenting.  But this does.
Many things from main() and below is very unclear.  Not only should everything inside main() be indented, but it appears that you're missing a closing brace (the one above class looks like it belongs to the while loop).

That's an odd place to declare the class.  It should be put into a separate header file, with this file including the header.  If you're going to have main() defined after everything else (which is good), make sure it is the last thing in the file.


Subcube


I'm not sure if you already have the implementation elsewhere and haven't included it here, but make sure you have something for it.  It would be helpful to see how those data members are used and how those member functions perform.
Everything is crammed into public, and there are some things that shouldn't be there.  The data members (k, hside, and e) should be under private.  The functions and constructor should stay public, unless some shouldn't be used by outside code.  If you're not using protected, just get rid of it.  It doesn't need to be there for nothing.
In printvector() and Subcubeset(), you don't need to pass the ints by const&amp;.  Passing an int is relatively cheap, so just pass them by value.
printvector() should be const as it shouldn't be modifying any data members:

void printvector(const int&amp; n) const;

Subcubeset() should use camelCase naming as it's a function.